summaryrefslogtreecommitdiff
path: root/float.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-15 19:46:32 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-15 19:46:32 -0700
commit214f549c5cd755661cd8a5d3b7c0ce4872d4afb6 (patch)
tree21d955c50c9b9594a4bb04e7bf485a09ed6c2baa /float.h
parent32f21f16fc7cb0bd5cf8dc3d54417295ecd3d57d (diff)
downloadnasm-214f549c5cd755661cd8a5d3b7c0ce4872d4afb6.tar.gz
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.
Diffstat (limited to 'float.h')
-rw-r--r--float.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/float.h b/float.h
index 769cc1ec..430c4643 100644
--- a/float.h
+++ b/float.h
@@ -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