If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.
Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.
jmburnod wrote: Sun Jan 02, 2022 10:14 am
Hi Andy,
I get same results (LC 9.6.5)
Best regards
Jean-Marc
Thanks Jean-Marc, wow it looks like the LiveCode programmers need to go back to the drawing board and also learn math at the same time Their engine is running on 3 cylinders
There are definitely limits in the way computers handle floating point integers with high numbers of digits. This cropped up a while back, and there was some discussion here about it. I believe it is the same implementation in LiveCode as many other high level languages, and is a factor of hooking into the underlying systems, rather than a shortcoming of the LiveCode programmers. There is a big number maths library coded by Geoff Canyon viewtopic.php?f=9&t=31793
Maybe you guys are right and I'm wrong. But I don't see what the problem is because it should only be a memory problem not a math problem. When you add two numbers together all your doing is just adding units and then carrying over if needed.
The problem isn't to do with memory, it's that numbers are handled in the engine with a limitation on the number of bits so you lose precision with very large numbers.
This is an inherent limitation, and has nothing to do with LC. You cannot do arithmetic operations with more than about 17 decimal digits. There is lot of discussion on the forum about this running for a decade.
I made a function, "longAdd", that added numbers of any length when I first started playing with LC. Never needed to, just because. But Hermann made functions for all four operations, and they are in the forum somewhere.
While it's true that this is more of a computer science thing than a LiveCode thing, if we can account for it in script why can't that script be included in the engine?
A bug report becomes a feature request.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
All true, that 17 digits ought not to be anyone's limit, But know that such a value is the equivalent of measuring the diameter of our galaxy to a precision of about a mile, or the diameter of the solar system to a tenth of a millimeter.
But HC has the same limitation that LC does. Any calculation that runs past 16 or 17 digits fails. I recall that Apple used "SANE", a protocol that may or may not still be used today, and that is where the , limitation lies.