Random big integers and string conversions.
Big integer to string (radix 2..16) ----------------------------------- A = -2#1010001110101110000011101001101111011010101001100000000111011101 00010100101100111110001100110011011011111# A = -3#2111222111002211201211022211020122020220020122100111212212011211 02# A = -4#11013113001310313231110300003232202211213301212123133# A = -5#424013231144131124223402321002421412010000231# A = -6#15350314215134555440023344023014023023315# A = -7#12531552233403336553105066252114402400# A = -8#50727016467552460035642454761463337# A = -9#748740846542842182262183147851542# A = -10#25936117084991265625088343828191# A = -11#153938A88447A241918A8365250A683# A = -12#1389794A3970ABA174050420B9AB3B# A = -13#18997034290259B52138511CA0310# A = -14#2D253316C77B8A30A5971304B9A7# A = -15#6CAA4C74BD3E72E813ABD788ACB# A = -16#1475C1D37B54C03BA2967C666DF# Save/load --------- Save A and load B (file: /home/fnx/demos/tmp.fnx) Check (A = B) : OK Big integer to string (using digit separators) ---------------------------------------------- B = -2#101000111 0101110000011101 0011011110110101 0100110000000011 1011101000101001 0110011111000110 0110011011011111# B = -16#147 5C1D 37B5 4C03 BA29 67C6 66DF# Big integer to string (using digit separators and left padded with 0's) ----------------------------------------------------------------------- B = -2#0000000101000111 0101110000011101 0011011110110101 0100110000000011 1011101000101001 0110011111000110 0110011011011111# B = -16#0147 5C1D 37B5 4C03 BA29 67C6 66DF# Big integer to string (using a representation without trailing zeros) --------------------------------------------------------------------- C = 8#12345670 00000000 00000000 00000000 00000000 00000000 00000000 00000000# C = 8#1234567#E57 String (radix = 10, using digit separators and exponent) to big integer ----------------------------------------------------------------------- S = '-0.0000000000 0000000000 0000000001 E30' A = -1 Check (A = -1) : OK String (radix = 2, Free Pascal convention) to big integer --------------------------------------------------------- S = '-%111111111111111' A = -2#111111111111111# Check (A = -%111111111111111) : OK String (radix = 8, Free Pascal convention) to big integer --------------------------------------------------------- S = '-&123456712345671' A = -8#123456712345671# Check (A = -&123456712345671) : OK String (radix = 16, Free Pascal convention) to big integer ---------------------------------------------------------- S = '-$123456789ABCDEF' A = -16#123456789ABCDEF# Check (A = -$123456789ABCDEF) : OK String (radix = 16, C convention) to big integer ------------------------------------------------ S = '-0x123456789ABCDEFp4' A = -16#123456789ABCDEF0# Check (A = -$123456789ABCDEF0) : OK







Sorry, this part cannot be displayed on small screens!