REXX 64 bit                                        goto homepage

welche Zahlen (dezimal, hexadezimal und binär) ergeben 2**1 bis 2**64?

 

 

/* REXX Y64BIT Copyright YCOS Yves Colliard Software 2005 */
/* TRACE ?R */
  /* einschalten des interaktiven Trace Modus */
  /* */
NUMERIC DIGITS 64
SAY LEFT(" ",15)" #                          DECIMAL",
                "                   HEXADECIMAL"
SAY LEFT(" ",15)"--        -------------------------",
                "      ------------------------"
SAY LEFT(" ",75)"BINARY"
SAY COPIES("-",81)
WERT=1
DO I=1 TO 64
  WERT=WERT*2
  SAY LEFT(" ",15)""FORMAT(I,2,0) ZGO(WERT,32) ZGO(D2X(WERT),30,2)
  SAY ZGO(X2B(D2X(WERT)),81,4)
END
EXIT
/* */
ZGO: PROCEDURE
IF ARG()=2 THEN DO
  DIF=3
END
ELSE DO
  DIF=ARG(3)
END
PARM=STRIP(ARG(1))
LP=LENGTH(PARM)
RES=""
ZW=""
DO WHILE LP>DIF
  RES=RIGHT(PARM,DIF)""ZW""RES
  ZW="."
  LP=LP-DIF
  PARM=LEFT(PARM,LP)
END
RETURN RIGHT(PARM""ZW""RES,ARG(2))

 

 

Resultat:

                #                           DECIMAL                   HEXADECIMAL
               --       --------------------------      -------------------------
                                                                           BINARY
---------------------------------------------------------------------------------
                1                                2                              2
                                                                             0010
                2                                4                              4
                                                                             0100
                3                                8                              8
                                                                             1000
                4                               16                             10
                                                                        0001.0000
                5                               32                             20
                                                                        0010.0000
                6                               64                             40
                                                                        0100.0000
                7                              128                             80
                                                                        1000.0000
                8                              256                           1.00
                                                                   0001.0000.0000
                9                              512                           2.00
                                                                   0010.0000.0000
               10                            1.024                           4.00
                                                                   0100.0000.0000
               11                            2.048                           8.00
                                                                   1000.0000.0000
               12                            4.096                          10.00
                                                              0001.0000.0000.0000
               13                            8.192                          20.00
                                                              0010.0000.0000.0000
               14                           16.384                          40.00
                                                              0100.0000.0000.0000
               15                           32.768                          80.00
                                                              1000.0000.0000.0000
               16                           65.536                        1.00.00
                                                         0001.0000.0000.0000.0000
               17                          131.072                        2.00.00
                                                         0010.0000.0000.0000.0000
               18                          262.144                        4.00.00
                                                         0100.0000.0000.0000.0000
               19                          524.288                        8.00.00
                                                         1000.0000.0000.0000.0000
               20                        1.048.576                       10.00.00
                                                    0001.0000.0000.0000.0000.0000
               21                        2.097.152                       20.00.00
                                                    0010.0000.0000.0000.0000.0000
               22                        4.194.304                       40.00.00
                                                    0100.0000.0000.0000.0000.0000
               23                        8.388.608                       80.00.00
                                                    1000.0000.0000.0000.0000.0000
               24                       16.777.216                     1.00.00.00
                                               0001.0000.0000.0000.0000.0000.0000
               25                       33.554.432                     2.00.00.00
                                               0010.0000.0000.0000.0000.0000.0000
               26                       67.108.864                     4.00.00.00
                                               0100.0000.0000.0000.0000.0000.0000
               27                      134.217.728                     8.00.00.00
                                               1000.0000.0000.0000.0000.0000.0000
               28                      268.435.456                    10.00.00.00
                                          0001.0000.0000.0000.0000.0000.0000.0000
               29                      536.870.912                    20.00.00.00
                                          0010.0000.0000.0000.0000.0000.0000.0000
               30                    1.073.741.824                    40.00.00.00
                                          0100.0000.0000.0000.0000.0000.0000.0000
               31                    2.147.483.648                    80.00.00.00
                                          1000.0000.0000.0000.0000.0000.0000.0000
               32                    4.294.967.296                  1.00.00.00.00
                                     0001.0000.0000.0000.0000.0000.0000.0000.0000
               33                    8.589.934.592                  2.00.00.00.00
                                     0010.0000.0000.0000.0000.0000.0000.0000.0000
               34                   17.179.869.184                  4.00.00.00.00
                                     0100.0000.0000.0000.0000.0000.0000.0000.0000
               35                   34.359.738.368                  8.00.00.00.00
                                     1000.0000.0000.0000.0000.0000.0000.0000.0000
               36                   68.719.476.736                 10.00.00.00.00
                                0001.0000.0000.0000.0000.0000.0000.0000.0000.0000
               37                  137.438.953.472                 20.00.00.00.00
                                0010.0000.0000.0000.0000.0000.0000.0000.0000.0000
               38                  274.877.906.944                 40.00.00.00.00
                                0100.0000.0000.0000.0000.0000.0000.0000.0000.0000
               39                  549.755.813.888                 80.00.00.00.00
                                1000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               40                1.099.511.627.776               1.00.00.00.00.00
                           0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               41                2.199.023.255.552               2.00.00.00.00.00
                           0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               42                4.398.046.511.104               4.00.00.00.00.00
                           0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               43                8.796.093.022.208               8.00.00.00.00.00
                           1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               44               17.592.186.044.416              10.00.00.00.00.00
                      0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               45               35.184.372.088.832              20.00.00.00.00.00
                      0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               46               70.368.744.177.664              40.00.00.00.00.00
                      0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               47              140.737.488.355.328              80.00.00.00.00.00
                      1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               48              281.474.976.710.656            1.00.00.00.00.00.00
                 0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               49              562.949.953.421.312            2.00.00.00.00.00.00
                 0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               50            1.125.899.906.842.624            4.00.00.00.00.00.00
                 0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               51            2.251.799.813.685.248            8.00.00.00.00.00.00
                 1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               52            4.503.599.627.370.496           10.00.00.00.00.00.00
            0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               53            9.007.199.254.740.992           20.00.00.00.00.00.00
            0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               54           18.014.398.509.481.984           40.00.00.00.00.00.00
            0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               55           36.028.797.018.963.968           80.00.00.00.00.00.00
            1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               56           72.057.594.037.927.936         1.00.00.00.00.00.00.00
       0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               57          144.115.188.075.855.872         2.00.00.00.00.00.00.00
       0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               58          288.230.376.151.711.744         4.00.00.00.00.00.00.00
       0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               59          576.460.752.303.423.488         8.00.00.00.00.00.00.00
       1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               60        1.152.921.504.606.846.976        10.00.00.00.00.00.00.00
  0001.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               61        2.305.843.009.213.693.952        20.00.00.00.00.00.00.00
  0010.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               62        4.611.686.018.427.387.904        40.00.00.00.00.00.00.00
  0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               63        9.223.372.036.854.775.808        80.00.00.00.00.00.00.00
  1000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
               64       18.446.744.073.709.551.616      1.00.00.00.00.00.00.00.00
1.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000