emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ?


From: Eli Zaretskii
Subject: Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ?
Date: Sat, 24 Oct 2009 11:05:17 +0200

> Date: Sat, 24 Oct 2009 10:50:33 +0900
> Cc: address@hidden
> From: Toru TSUNEYOSHI <address@hidden>
> 
>       val = make_fixnum_or_float (sign * v); /* <= type of argument is 
> `double' */
>     }
> 
> So in 64-bit platforms, casting `double' to `int' causes lack of
> precision already (because a double does not have 64 bits in the
> mantissa), doesn't it?

No.  The cast inside make_fixnum_or_float is to EMACS_INT, not to
`int'.  On 64-bit platforms, EMACS_INT is a 64-bit type, so casting a
`double' to EMACS_INT does not lose any precision.  Casting an
EMACS_INT to a `double' will cause loss of significant digits in the
EMACS_INT value.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]