diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-22 16:53:48 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-22 16:53:48 -0700 |
commit | bea0bbb62c9947421bc0fddcd2b58a40435e2181 (patch) | |
tree | 21623213cc08b04a9eb771b2a46bb1e057a1948c /float.c | |
parent | 3b2ad1bc370653e90d6b2fa9cfc587a7aea405f3 (diff) | |
download | nasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.tar.gz nasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.tar.bz2 nasm-bea0bbb62c9947421bc0fddcd2b58a40435e2181.zip |
More consistent handling of radix letters
Allow any radix letter from the set [bydtoqhx] to be used either
"Intel-style" (0...x) or "C-style" (0x...). In Intel style, the
leading 0 remains optional as long as the first digit is in the range
0-9.
As a consequence, allow the prefix "0h" for hexadecimal floating
point.
Diffstat (limited to 'float.c')
-rw-r--r-- | float.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -656,7 +656,8 @@ static int to_float(const char *str, int sign, uint8_t * result, break; } } else { - if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) + if (str[0] == '0' && + (str[1] == 'x' || str[1] == 'X' || str[1] == 'h' || str[1] == 'H')) ok = ieee_flconvert_hex(str + 2, mant, &exponent); else if (str[0] == '$') ok = ieee_flconvert_hex(str + 1, mant, &exponent); |