A Script that i was working on recently was driving me crazy because it would --Almost-- work...
So i tediously worked though each step, and then created a secondary list that recorded each value as it generated in this loop...
And discovered to my astonishment that this one loop, which subtracted one value from another and then multiplied that by 10, worked again & again,
Until the numbers became kind of small,
and 6.43 - 6 Then x 10
Resulted in 4.29999999999998
And there after; This was the number that the loop used in the nest itineration...!
i managed to fix it, but it required a very ugly kludge in the middle of the script.
This occurs in my IsThisNumberPrime? Script; SubScript WholeToList.
???
Offline
Floating point numbers (numbers with a decimal point) on computers are often an approximation, due to the limited number of bits available to represent them. You have to design your algorithms around those limitations - it can be a challenge
Offline