Re: Probably for David Cuny
- Posted by Robert Craig <rds at ATTCANADA.NET> Jul 27, 1999
- 444 views
Terry Moriarty writes: > while temp != 0 do > my_string = ((((temp/10)-(floor(temp/10)))*10)+48) & my_string > temp = floor(temp/10) > end while Yes, this is what I suspected. You fell into the very common trap of requiring floating-point results to be perfectly accurate. The characters in my_string will not necessarily all be perfect integers. For example, (61/10 - floor(61/10)) * 10 will probably not be *exactly* 1. It might be something like 0.99999999999999 which rounds down (later on) to 0. You could round your digits, with something like digit = floor(digit+0.5) to make them exact integers (or just use sprint()). Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/