Subject: 23.1.50; (string-to-number (number-to-string most-positive-fixnum))

From: Helmut Eller <[email-masked]>
Date: Thu, 03 Dec 2009 15:36:27 +0100

(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.

Helmut.

In GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu)
 of 2009-12-03
configured using `configure  '--without-x''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t