New floating-point conversion routines

Substitute in nasm64developer's "acfloat4" routine.  This
floating-point conversion routine is not perfect (it gets a fair
number of LSB errors), but the old NASM code was just plain broken.
nasm64developer's code at least gets within ±1 LSB.
This commit is contained in:
H. Peter Anvin 2007-10-15 19:46:32 -07:00
parent 32f21f16fc
commit 214f549c5c
2 changed files with 566 additions and 333 deletions

890
float.c

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,14 @@
#ifndef NASM_FLOAT_H
#define NASM_FLOAT_H
int float_const(char *number, int32_t sign, uint8_t *result, int bytes,
enum float_round {
FLOAT_RC_NEAR,
FLOAT_RC_ZERO,
FLOAT_RC_DOWN,
FLOAT_RC_UP,
};
int float_const(const char *string, int sign, uint8_t *result, int bytes,
efunc error);
#endif