ack/modules/src
George Koehler 3bb41d3910 Switch flt_mantissa fields from long to uint32_t.
This seems to fix an error when flt_arith converts a literal
double-precision float to IEEE format.  For example, 0.5 and 0.75 got
converted to slightly below their correct values.

My host gcc for amd64 has 64-bit long, but flt_arith needs only 32
bits.  The code (at least flt_add.c) can make 32-bit overflows.  Such
overflows would set the higher bits of a 64-bit long, which might
cause problems later.

I need to use uint32_t and not int32_t because the code still uses
long, and the sign extension from int32_t to long would cause
problems.  The mantissa represents a value in [0, 2) that can't be
negative, so unsigned type is better.  Also, signed overflow is
undefined behavior in C, so flt_add.c better make overflows with
uint32_t and not int32_t.

This commit doesn't touch lang/cem/libcc.ansi/stdlib/ext_fmt.h which
continues to use unsigned long for its mantissa fields.
2016-11-05 17:00:24 -04:00
..
alloc Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
assert Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
em_code Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
em_data Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
em_mes Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
em_opt Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
flt_arith Switch flt_mantissa fields from long to uint32_t. 2016-11-05 17:00:24 -04:00
idf Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
input Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
malloc Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
object Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
print Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
read_em Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
string Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
system Properly declare the library headers as dependencies. 2016-11-05 11:47:36 +01:00
Xmalloc Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
Action Added flt_arith 1989-07-10 11:25:02 +00:00
Action.lint Changed action names to reflect action taken 1991-11-22 13:55:56 +00:00