]> git.eshelyaron.com Git - emacs.git/commit
* data.c: Avoid integer truncation in expressions involving floats.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 May 2011 05:38:43 +0000 (22:38 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 May 2011 05:38:43 +0000 (22:38 -0700)
commit0ae6bdee0085b05028108325b0a4ce979eadb24e
tree51746679d14a133e355aeb2effe115db5dd692f5
parentde883a701d8f0db9595c6c459fdff9e3bb20bc83
* data.c: Avoid integer truncation in expressions involving floats.

* data.c: Include <intprops.h>.
(arith_driver): When there's an integer overflow in an expression
involving floating point, convert the integers to floating point
so that the resulting value does not suffer from catastrophic
integer truncation.  For example, on a 64-bit host (* 4
most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
Do not rely on undefined behavior after integer overflow.
src/ChangeLog
src/data.c