Page 1 of 1
Range of double numbers?
Posted: Wed Oct 03, 2012 3:23 pm
by rko
hi,
can you plese tell me what the range of double is - for example like "8 bytes Real numbers with an approximate range of 4.19E-307 to 1.67E+308"
thanx
Re: Range of double numbers?
Posted: Wed Oct 03, 2012 3:39 pm
by STARGÅTE
the highest storable double is: ± 1.7976931348623157e308
the lowes positive double is: 2.2250738585072013e-308
Re: Range of double numbers?
Posted: Sat Jan 07, 2017 1:47 am
by Keya
it seems the maximum for Double might be slightly understated in the PB docs?
In C:
Code: Select all
printf("%f", DBL_MAX);
179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
^
In PB, using the docs suggested max yields a
slightly lower figure:
Code: Select all
dbl.d = 1.7976931348623157e+308 : Debug StrD(dbl)
179769313486231550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
^
But if i change that from "157e+" to "158e+" the output then matches that of the C output:
Code: Select all
dbl.d = 1.7976931348623158e+308 : Debug StrD(dbl)
179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
^