Subject: Re: bug#5114: 23.1.50; (string-to-number (number-to-string most-positive-fixnum))

From: Stefan Monnier <[email-masked]>
Date: Thu, 03 Dec 2009 15:52:16 -0500

> (setq x (string-to-number (number-to-string most-positive-fixnum)))
> (= most-positive-fixnum x) => nil
   
> x is 2305843009213693440 but it should be most-positive-fixnum
> which is 2305843009213693951.

> The test
> (= most-positive-fixnum 
>    (string-to-number (number-to-string most-positive-fixnum)))
> seems to work as expected on 32-bit machines but not so on 64 bit.

Indeed, it passes through a floating point conversion, so there's only
abour 52 bit of precesion.

        Stefan