Interesting but not something I ever studied...
So with this
a = -2.1E-45
PRINT a
a = -2.11E-45
PRINT a: END
a = -1.401298E-45
a = -2.802597E-45 (That's the lowest value as printed in the WIKI.)
If E-46 is used, the value is out of bounds and returns as zero; however, if a = 2.802598 is used, it still outputs the value of -2.802597E-45.
I guess I'm just happy I don't have anything I use that tests these boundaries.
Pete
OK, so since I still have some old QBasic books on the shelves...
Max Min
Integers: 32,767 -32,768
Long Integers: 2,147,483,647 -2,147,483,648
+Single Precision: 3.402823 E+38 1.401298 E-45
-Single Precision: -1.401298 E-45 -3.402823 E+38
+Double Precision: 1.797693134862315 D+308 4.9406564584412465 D-324
-Double Precision: -4.9406564584412465 D-324 -1.797693134862315 D+308
The WIKI differs in Single Precision, which is listed as -2.802597E-45 instead of the MS QB book limit of -1.401298 E-45
I don't have a copy of QB45 running right now, or I'd test my code above to see if it gave a different output.
Edited to change -32,767 to correct value of -32,768. Thanks RonB.