Jun 17, 2016, 9:13 PM
Post #6 of 11
Your problem is the precision of floating point numbers. The FAQ that I referred you to may not seem applicable, but read it carefully. It refers you to the definitive article on the subject. (Although it does not require advanced math skills, It is definitely not easy reading)
Re: [amyth] Do Until condition issue
[In reply to]
Perl does not have data types (at least not in the sense of most other languages). All arithmetic is done in floating point. The exact floating point format depends primarily on your hardware.
In general, decimal numbers cannot be represented exactly in floating point. Because of this, it is almost never right to test for equality. (Ok, I did it in my code, but I gave you an alternative if it did not work on your system.) The reason my code does work is that "small" integers values can be represented exactly. The number of microseconds is always an integer less than 10^6.