Parse a partial, non-special floating point number.
This creates a representation of the float as the significant digits and the decimal exponent.
fn parsePartialNumber(comptime T: type, s: []const u8, negative: bool, n: *usize) ?Number(T)
fn parsePartialNumber(comptime T: type, s: []const u8, negative: bool, n: *usize) ?Number(T) {
std.debug.assert(s.len != 0);
const MantissaT = common.mantissaType(T);
n.* = 0;
if (s.len >= 2 and s[0] == '0' and std.ascii.toLower(s[1]) == 'x') {
var stream = FloatStream.init(s[2..]);
n.* += 2;
return parsePartialNumberBase(T, &stream, negative, n, .{
.base = 16,
.max_mantissa_digits = if (MantissaT == u64) 16 else 32,
.exp_char_lower = 'p',
});
} else {
var stream = FloatStream.init(s);
return parsePartialNumberBase(T, &stream, negative, n, .{
.base = 10,
.max_mantissa_digits = if (MantissaT == u64) 19 else 38,
.exp_char_lower = 'e',
});
}
}