From: Ryan Davis Date: 2012-01-24T10:23:36+09:00 Subject: Re: Microrant on Ruy's Math Skills On Jan 23, 2012, at 16:57 , Chad Perrin wrote: > On Tue, Jan 24, 2012 at 08:19:06AM +0900, Ryan Davis wrote: >> >> Except for that whole "parse time is different from run time" part you >> seem to be blithely ignoring. If you've already parsed float literals, >> then they're floats and are already lossy. > > Are you telling me that 1.1 is automatically lossy, regardless of how you > got there? I guess I need to go back and refresh my understanding of the > math, because I thought a literal decimal number was fine but one > achieved by arithmetic was likely to contain subtle errors due to the way > the binary math is handled. It'd be nice if you read the thread before chipping in. Adam Prescott nailed this one. Here's another example: % ruby -e 'puts "%.60f" % 1.1' 1.100000000000000088817841970012523233890533447265625000000000