Variable size/Set: Difference between revisions

m
Line 398:
 
Sequences are 4 or 8 bytes per element, and can grow or shrink at will.<br>
Strings are always one byte per character, (ie ansi or utf-8), utf-16 and utf-32 are held as sequences.
 
When using mprf.e (aka gmp), variables can have any precision required, up to available memory.<br>
Line 404:
mpfr (floating point) variables require the precision to be explicitly specified in binary bits, for example if you want PI to 1000 decimal places:
<lang Phix>include mpfr.e -- requires 0.8.0+
string nines = repeat('9',10001001) -- +1 for the "3."
mpz ndp = mpz_init(nines) -- mpz_init(nines,3322) would be identical
integer precision = mpz_sizeinbase(ndp,2) -- 3322
7,806

edits