Files
pplus-library/mojo/probes/string-atof-decimal.mojo
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

27 lines
638 B
Mojo

# probe: which decimal texts does atof read, and as which Float64? (signs, exponents, leading zeros, a bare point, many digits, the smallest subnormal, past the range)
def show(t: String):
try:
print(t, "->", atof(t))
except e:
print(t, "-> raised:", e)
def main():
show("2.5")
show("1e3")
show("-0.125")
show("10")
show("007.5")
show("0.1")
show("+3")
show(".5")
show("5.")
show("-0")
show("1E-2")
show("123456789012345678901234567890")
show("2.2250738585072011e-308")
show("4.9e-324")
show("1e400")
show("1e-400")
show("0.30000000000000004")