Literals/Integer: Difference between revisions

Content added Content deleted
Line 1,944: Line 1,944:
<lang smalltalk>2r1011010111 + 5r100 + 8r1327 + 10r727 + 16r2d7 / 4</lang>
<lang smalltalk>2r1011010111 + 5r100 + 8r1327 + 10r727 + 16r2d7 / 4</lang>
binary, base-5, octal, decimal, binary, decimal (default). The radix is any between 2 and 32 (although only 2, 8, 10 and 16 are typically needed).
binary, base-5, octal, decimal, binary, decimal (default).
Any base between 2 and 32 can be used (although only 2, 8, 10 and 16 are typically needed).


There is no size limit (except memory constraints), the runtime chooses an appropriate representation automatically:
There is no size limit (except memory constraints), the runtime chooses an appropriate representation automatically:
<lang smalltalk>16r1B30964EC395DC24069528D54BBDA40D16E966EF9A70EB21B5B2943A321CDF10391745570CCA9420C6ECB3B72ED2EE8B02EA2735C61A000000000000000000000000 = 100 factorial
<lang smalltalk>16r1B30964EC395DC24069528D54BBDA40D16E966EF9A70EB21B5B2943A321CDF10391745570CCA9420C6ECB3B72ED2EE8B02EA2735C61A000000000000000000000000 = 100 factorial
"evaluates to true"</lang>
"evaluates to true"

2r101010101011111100000011111000000111111111111111110101010101010101010100101000000000111111100000000111
bitCount -> 55</lang>


=={{header|Standard ML}}==
=={{header|Standard ML}}==