Too LONG?
Sniper King
Posts: 221
What happens to a local variable (LONG)·if you put a number into it that is too big? If you dimension it as (a[noparse][[/noparse]2]) will that help?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
Comments
and that's how big a LONG is.
So explain more, please. If I try to store 8_000_000_000 into a LONG, that 8B needs to come from somewhere.
In general, if the origin is arithmetic (addition, subtraction, multiplication), you will get the result modulo 2^32
(with the number interpreted with or without a sign).
But if you give us a bit more context we may be able to provide a more useful answer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
If you do calculations in floating point, you can have values greater than 2^32, but floating point trades accuracy for range. You may be able to have values much greater than 2^32, but all numbers and all arithmetic operations are limited to about 7 digits of accuracy.
Post Edited (Mike Green) : 9/25/2008 7:54:01 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
Google "wiki floating point".
If you do all your "big" calculations in floating point, the largest number can be 2^127 (roughly 10^38).
As I mentioned, there are only about 7 significant digits in these values even though the magnitude can be large.
If you try to subtract 1.0 from 100_000_000.0 using floating point subtraction, you'll get 100_000_000.0 because
the 1.0 is insignificant. If you try to use integer operations, you'll get garbage.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.