Subject: Re: bug#19025: 24.4; precision error when adding two floats

From: Jay Belanger <[email-masked]>
Date: Tue, 11 Nov 2014 20:28:49 -0600

>> (message "%s" (+ 379.744 57.93))
>>
>> The above prints 437.67400000000004.  Same if I use 57.930, but if I
>> use 57.931 (below) I get the correct answer 437.675.
>>  
>> (message "%s" (+ 379.744 57.931))
>>
>> I was able to work around by using format:
>>  
>> (message "%s" (format "%f" (+ 379.744 57.93)))
>>
>> which prints 437.674000.
>>  
>> FYI, I can replicate the issue with Emacs 21.3.1.
>
> Isn't this an artifact of the nature of floating-point arithmetic, rather than
> an issue with Emacs per se?

Yes, although it probably wouldn't be a bad idea to point out this issue
in the Elisp documentation.