Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-js

Source of release 0.6.0

0.6.0 / src / dtoa / tests_atod_2.lucb

#==============================================================================================
#
#   tests_atod_2 - Expected atod results pinned from the C dtoa.c
#
#   DESCRIPTION:
#       Generated by a C driver compiled against upstream QuickJS dtoa.c (2026-06-04): each
#       line is one call and the exact bytes (or bits) C produced. Do not edit by hand.
#
#==============================================================================================

test "js_atod 6":
    check_atod("1@2", 0, 1, 0x3ff0000000000000, 1)
    check_atod("1@2", 0, 2, 0x3ff0000000000000, 1)
    check_atod("1@2", 0, 4, 0x3ff0000000000000, 1)
    check_atod("1@2", 0, 8, 0x3ff0000000000000, 1)
    check_atod("1@2", 0, 14, 0x3ff0000000000000, 1)
    check_atod("3.14159265358979323846264338327950288", 0, 0, 0x400921fb54442d18, 37)
    check_atod("3.14159265358979323846264338327950288", 0, 1, 0x4008000000000000, 1)
    check_atod("3.14159265358979323846264338327950288", 0, 2, 0x400921fb54442d18, 37)
    check_atod("3.14159265358979323846264338327950288", 0, 4, 0x400921fb54442d18, 37)
    check_atod("3.14159265358979323846264338327950288", 0, 8, 0x400921fb54442d18, 37)
    check_atod("3.14159265358979323846264338327950288", 0, 14, 0x400921fb54442d18, 37)
    check_atod("0.000000000000000000000000000000000000001", 0, 0, 0x37d5c72fb1552d83, 41)
    check_atod("0.000000000000000000000000000000000000001", 0, 1, 0x0000000000000000, 1)
    check_atod("0.000000000000000000000000000000000000001", 0, 2, 0x37d5c72fb1552d83, 41)
    check_atod("0.000000000000000000000000000000000000001", 0, 4, 0x37d5c72fb1552d83, 41)
    check_atod("0.000000000000000000000000000000000000001", 0, 8, 0x37d5c72fb1552d83, 41)
    check_atod("0.000000000000000000000000000000000000001", 0, 14, 0x37d5c72fb1552d83, 41)
    check_atod("0x1fffffffffffff", 0, 0, 0x433fffffffffffff, 16)
    check_atod("0x1fffffffffffff", 0, 1, 0x433fffffffffffff, 16)
    check_atod("0x1fffffffffffff", 0, 2, 0x433fffffffffffff, 16)
    check_atod("0x1fffffffffffff", 0, 4, 0x433fffffffffffff, 16)
    check_atod("0x1fffffffffffff", 0, 8, 0x433fffffffffffff, 16)
    check_atod("0x1fffffffffffff", 0, 14, 0x433fffffffffffff, 16)
    check_atod("0x20000000000001", 0, 0, 0x4340000000000000, 16)
    check_atod("0x20000000000001", 0, 1, 0x4340000000000000, 16)
    check_atod("0x20000000000001", 0, 2, 0x4340000000000000, 16)
    check_atod("0x20000000000001", 0, 4, 0x4340000000000000, 16)
    check_atod("0x20000000000001", 0, 8, 0x4340000000000000, 16)
    check_atod("0x20000000000001", 0, 14, 0x4340000000000000, 16)
    check_atod("0x20000000000003", 0, 0, 0x4340000000000002, 16)
    check_atod("0x20000000000003", 0, 1, 0x4340000000000002, 16)
    check_atod("0x20000000000003", 0, 2, 0x4340000000000002, 16)
    check_atod("0x20000000000003", 0, 4, 0x4340000000000002, 16)
    check_atod("0x20000000000003", 0, 8, 0x4340000000000002, 16)
    check_atod("0x20000000000003", 0, 14, 0x4340000000000002, 16)
    check_atod("0xffffffffffffffffff", 0, 0, 0x4470000000000000, 20)
    check_atod("0xffffffffffffffffff", 0, 1, 0x4470000000000000, 20)
    check_atod("0xffffffffffffffffff", 0, 2, 0x4470000000000000, 20)
    check_atod("0xffffffffffffffffff", 0, 4, 0x4470000000000000, 20)
    check_atod("0xffffffffffffffffff", 0, 8, 0x4470000000000000, 20)
    check_atod("0xffffffffffffffffff", 0, 14, 0x4470000000000000, 20)
    check_atod("0x1.fffffffffffff8p1023", 0, 0, 0x7ff0000000000000, 23)
    check_atod("0x1.fffffffffffff8p1023", 0, 1, 0x3ff0000000000000, 3)
    check_atod("0x1.fffffffffffff8p1023", 0, 2, 0x7ff0000000000000, 23)
    check_atod("0x1.fffffffffffff8p1023", 0, 4, 0x7ff0000000000000, 23)
    check_atod("0x1.fffffffffffff8p1023", 0, 8, 0x7ff0000000000000, 23)
    check_atod("0x1.fffffffffffff8p1023", 0, 14, 0x7ff0000000000000, 23)
    check_atod("0x.8", 0, 0, 0x7ff8000000000000, 2)
    check_atod("0x.8", 0, 1, 0x7ff8000000000000, 2)
    check_atod("0x.8", 0, 2, 0x7ff8000000000000, 2)
    check_atod("0x.8", 0, 4, 0x7ff8000000000000, 2)
    check_atod("0x.8", 0, 8, 0x7ff8000000000000, 2)
    check_atod("0x.8", 0, 14, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 0, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 1, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 2, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 4, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 8, 0x7ff8000000000000, 2)
    check_atod("0x.", 0, 14, 0x7ff8000000000000, 2)
    check_atod("-0x0", 0, 0, 0x8000000000000000, 4)
    check_atod("-0x0", 0, 1, 0x8000000000000000, 4)
    check_atod("-0x0", 0, 2, 0x8000000000000000, 4)
    check_atod("-0x0", 0, 4, 0x8000000000000000, 4)
    check_atod("-0x0", 0, 8, 0x8000000000000000, 4)
    check_atod("-0x0", 0, 14, 0x8000000000000000, 4)
    check_atod("1.e5", 0, 0, 0x40f86a0000000000, 4)
    check_atod("1.e5", 0, 1, 0x3ff0000000000000, 1)
    check_atod("1.e5", 0, 2, 0x40f86a0000000000, 4)
    check_atod("1.e5", 0, 4, 0x40f86a0000000000, 4)
    check_atod("1.e5", 0, 8, 0x40f86a0000000000, 4)
    check_atod("1.e5", 0, 14, 0x40f86a0000000000, 4)
    check_atod(".e5", 0, 0, 0x7ff8000000000000, 0)
    check_atod(".e5", 0, 1, 0x7ff8000000000000, 0)
    check_atod(".e5", 0, 2, 0x7ff8000000000000, 0)
    check_atod(".e5", 0, 4, 0x7ff8000000000000, 0)
    check_atod(".e5", 0, 8, 0x7ff8000000000000, 0)
    check_atod(".e5", 0, 14, 0x7ff8000000000000, 0)
    check_atod("1e5.5", 0, 0, 0x40f86a0000000000, 3)
    check_atod("1e5.5", 0, 1, 0x3ff0000000000000, 1)
    check_atod("1e5.5", 0, 2, 0x40f86a0000000000, 3)
    check_atod("1e5.5", 0, 4, 0x40f86a0000000000, 3)
    check_atod("1e5.5", 0, 8, 0x40f86a0000000000, 3)
    check_atod("1e5.5", 0, 14, 0x40f86a0000000000, 3)

test "js_atod radix 1":
    check_atod("ff", 2, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 2, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 2, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 2, 8, 0x0000000000000000, 1)
    check_atod("10", 2, 0, 0x4000000000000000, 2)
    check_atod("1.1", 2, 8, 0x3ff8000000000000, 3)
    check_atod("0.1", 2, 0, 0x3fe0000000000000, 3)
    check_atod("z.z", 2, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 2, 0, 0x4010000000000000, 3)
    check_atod("1p3", 2, 8, 0x4020000000000000, 3)
    check_atod("1e3", 2, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 2, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 2, 0, 0x4400000000000000, 65)
    check_atod("0.00001", 2, 8, 0x3fa0000000000000, 7)
    check_atod("123abc", 2, 0, 0x3ff0000000000000, 1)
    check_atod("1_0", 2, 8, 0x4000000000000000, 3)
    check_atod("gg", 2, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 2, 8, 0x3fe0000000000000, 2)
    check_atod("1e-5", 2, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 3, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 3, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 3, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 3, 8, 0x0000000000000000, 1)
    check_atod("10", 3, 0, 0x4008000000000000, 2)
    check_atod("1.1", 3, 8, 0x3ff5555555555555, 3)
    check_atod("0.1", 3, 0, 0x3fd5555555555555, 3)
    check_atod("z.z", 3, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 3, 0, 0x4022000000000000, 3)
    check_atod("1p3", 3, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 3, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 3, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 3, 0, 0x4650408fc1d5cd73, 65)
    check_atod("0.00001", 3, 8, 0x3f70db20a88f4696, 7)
    check_atod("123abc", 3, 0, 0x4014000000000000, 2)
    check_atod("1_0", 3, 8, 0x4008000000000000, 3)
    check_atod("gg", 3, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 3, 8, 0x3fd5555555555555, 2)
    check_atod("1e-5", 3, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 4, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 4, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 4, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 4, 8, 0x0000000000000000, 1)
    check_atod("10", 4, 0, 0x4010000000000000, 2)
    check_atod("1.1", 4, 8, 0x3ff4000000000000, 3)
    check_atod("0.1", 4, 0, 0x3fd0000000000000, 3)
    check_atod("z.z", 4, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 4, 0, 0x4030000000000000, 3)
    check_atod("1p3", 4, 8, 0x4020000000000000, 3)
    check_atod("1e3", 4, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 4, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 4, 0, 0x47f5555555555555, 65)
    check_atod("0.00001", 4, 8, 0x3f50000000000000, 7)
    check_atod("123abc", 4, 0, 0x403b000000000000, 3)
    check_atod("1_0", 4, 8, 0x4010000000000000, 3)
    check_atod("gg", 4, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 4, 8, 0x3fd0000000000000, 2)
    check_atod("1e-5", 4, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 5, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 5, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 5, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 5, 8, 0x0000000000000000, 1)
    check_atod("10", 5, 0, 0x4014000000000000, 2)
    check_atod("1.1", 5, 8, 0x3ff3333333333333, 3)
    check_atod("0.1", 5, 0, 0x3fc999999999999a, 3)
    check_atod("z.z", 5, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 5, 0, 0x4039000000000000, 3)
    check_atod("1p3", 5, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 5, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 5, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 5, 0, 0x493e62c4e38ff872, 65)
    check_atod("0.00001", 5, 8, 0x3f34f8b588e368f1, 7)
    check_atod("123abc", 5, 0, 0x4043000000000000, 3)
    check_atod("1_0", 5, 8, 0x4014000000000000, 3)
    check_atod("gg", 5, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 5, 8, 0x3fc999999999999a, 2)
    check_atod("1e-5", 5, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 6, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 6, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 6, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 6, 8, 0x0000000000000000, 1)
    check_atod("10", 6, 0, 0x4018000000000000, 2)
    check_atod("1.1", 6, 8, 0x3ff2aaaaaaaaaaab, 3)
    check_atod("0.1", 6, 0, 0x3fc5555555555555, 3)
    check_atod("z.z", 6, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 6, 0, 0x4042000000000000, 3)
    check_atod("1p3", 6, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 6, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 6, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 6, 0, 0x4a4a00e602efaf1e, 65)
    check_atod("0.00001", 6, 8, 0x3f20db20a88f4696, 7)
    check_atod("123abc", 6, 0, 0x4049800000000000, 3)
    check_atod("1_0", 6, 8, 0x4018000000000000, 3)
    check_atod("gg", 6, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 6, 8, 0x3fc5555555555555, 2)
    check_atod("1e-5", 6, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 7, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 7, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 7, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 7, 8, 0x0000000000000000, 1)
    check_atod("10", 7, 0, 0x401c000000000000, 2)
    check_atod("1.1", 7, 8, 0x3ff2492492492492, 3)
    check_atod("0.1", 7, 0, 0x3fc2492492492492, 3)
    check_atod("z.z", 7, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 7, 0, 0x4048800000000000, 3)
    check_atod("1p3", 7, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 7, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 7, 8, 0x7ff8000000000000, 1)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 7, 0, 0x4b2db6f9fbf7397f, 65)
    check_atod("0.00001", 7, 8, 0x3f0f31d2b36647fc, 7)
    check_atod("123abc", 7, 0, 0x4050800000000000, 3)
    check_atod("1_0", 7, 8, 0x401c000000000000, 3)
    check_atod("gg", 7, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 7, 8, 0x3fc2492492492492, 2)
    check_atod("1e-5", 7, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 8, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 8, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 8, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 8, 8, 0x0000000000000000, 1)
    check_atod("10", 8, 0, 0x4020000000000000, 2)
    check_atod("1.1", 8, 8, 0x3ff2000000000000, 3)

test "js_atod radix 2":
    check_atod("0.1", 8, 0, 0x3fc0000000000000, 3)
    check_atod("z.z", 8, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 8, 0, 0x4050000000000000, 3)
    check_atod("1p3", 8, 8, 0x4020000000000000, 3)
    check_atod("1e3", 8, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 8, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 8, 0, 0x4bf2492492492492, 65)
    check_atod("0.00001", 8, 8, 0x3f00000000000000, 7)
    check_atod("123abc", 8, 0, 0x4054c00000000000, 3)
    check_atod("1_0", 8, 8, 0x4020000000000000, 3)
    check_atod("gg", 8, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 8, 8, 0x3fc0000000000000, 2)
    check_atod("1e-5", 8, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 9, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 9, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 9, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 9, 8, 0x0000000000000000, 1)
    check_atod("10", 9, 0, 0x4022000000000000, 2)
    check_atod("1.1", 9, 8, 0x3ff1c71c71c71c72, 3)
    check_atod("0.1", 9, 0, 0x3fbc71c71c71c71c, 3)
    check_atod("z.z", 9, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 9, 0, 0x4054400000000000, 3)
    check_atod("1p3", 9, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 9, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 9, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 9, 0, 0x4ca0822406c5eb4b, 65)
    check_atod("0.00001", 9, 8, 0x3ef1c1fa5f678884, 7)
    check_atod("123abc", 9, 0, 0x4059800000000000, 3)
    check_atod("1_0", 9, 8, 0x4022000000000000, 3)
    check_atod("gg", 9, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 9, 8, 0x3fbc71c71c71c71c, 2)
    check_atod("1e-5", 9, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 10, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 10, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 10, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 10, 8, 0x0000000000000000, 1)
    check_atod("10", 10, 0, 0x4024000000000000, 2)
    check_atod("1.1", 10, 8, 0x3ff199999999999a, 3)
    check_atod("0.1", 10, 0, 0x3fb999999999999a, 3)
    check_atod("z.z", 10, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 10, 0, 0x3ff0000000000000, 1)
    check_atod("1p3", 10, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 10, 0, 0x408f400000000000, 3)
    check_atod("-7fffffffffffffff", 10, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 10, 0, 0x4d3b02761f9c6b10, 65)
    check_atod("0.00001", 10, 8, 0x3ee4f8b588e368f1, 7)
    check_atod("123abc", 10, 0, 0x405ec00000000000, 3)
    check_atod("1_0", 10, 8, 0x4024000000000000, 3)
    check_atod("gg", 10, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 10, 8, 0x3fb999999999999a, 2)
    check_atod("1e-5", 10, 0, 0x3ee4f8b588e368f1, 4)
    check_atod("ff", 11, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 11, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 11, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 11, 8, 0x0000000000000000, 1)
    check_atod("10", 11, 0, 0x4026000000000000, 2)
    check_atod("1.1", 11, 8, 0x3ff1745d1745d174, 3)
    check_atod("0.1", 11, 0, 0x3fb745d1745d1746, 3)
    check_atod("z.z", 11, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 11, 0, 0x405e400000000000, 3)
    check_atod("1p3", 11, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 11, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 11, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 11, 0, 0x4dc7482041f6cddd, 65)
    check_atod("0.00001", 11, 8, 0x3eda0b17895e3969, 7)
    check_atod("123abc", 11, 0, 0x4099400000000000, 4)
    check_atod("1_0", 11, 8, 0x4026000000000000, 3)
    check_atod("gg", 11, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 11, 8, 0x3fb745d1745d1746, 2)
    check_atod("1e-5", 11, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 12, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 12, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 12, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 12, 8, 0x0000000000000000, 1)
    check_atod("10", 12, 0, 0x4028000000000000, 2)
    check_atod("1.1", 12, 8, 0x3ff1555555555555, 3)
    check_atod("0.1", 12, 0, 0x3fb5555555555555, 3)
    check_atod("z.z", 12, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 12, 0, 0x4062000000000000, 3)
    check_atod("1p3", 12, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 12, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 12, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 12, 0, 0x4e47a3b9d41fb678, 65)
    check_atod("0.00001", 12, 8, 0x3ed0db20a88f4696, 7)
    check_atod("123abc", 12, 0, 0x40d82cc000000000, 5)
    check_atod("1_0", 12, 8, 0x4028000000000000, 3)
    check_atod("gg", 12, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 12, 8, 0x3fb5555555555555, 2)
    check_atod("1e-5", 12, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 13, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 13, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 13, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 13, 8, 0x0000000000000000, 1)
    check_atod("10", 13, 0, 0x402a000000000000, 2)
    check_atod("1.1", 13, 8, 0x3ff13b13b13b13b1, 3)
    check_atod("0.1", 13, 0, 0x3fb3b13b13b13b14, 3)
    check_atod("z.z", 13, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 13, 0, 0x4065200000000000, 3)
    check_atod("1p3", 13, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 13, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 13, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 13, 0, 0x4ebec607a7fb31ec, 65)
    check_atod("0.00001", 13, 8, 0x3ec697cc3ea40f41, 7)
    check_atod("123abc", 13, 0, 0x411aa9cc00000000, 6)
    check_atod("1_0", 13, 8, 0x402a000000000000, 3)
    check_atod("gg", 13, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 13, 8, 0x3fb3b13b13b13b14, 2)
    check_atod("1e-5", 13, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 14, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 14, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 14, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 14, 8, 0x0000000000000000, 1)
    check_atod("10", 14, 0, 0x402c000000000000, 2)
    check_atod("1.1", 14, 8, 0x3ff1249249249249, 3)
    check_atod("0.1", 14, 0, 0x3fb2492492492492, 3)
    check_atod("z.z", 14, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 14, 0, 0x4068800000000000, 3)
    check_atod("1p3", 14, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 14, 0, 0x3ff0000000000000, 1)
    check_atod("-7fffffffffffffff", 14, 8, 0xc01c000000000000, 2)

test "js_atod radix 3":
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 14, 0, 0x4f2b6dd30ff7e64e, 65)
    check_atod("0.00001", 14, 8, 0x3ebf31d2b36647fc, 7)
    check_atod("123abc", 14, 0, 0x412312ec00000000, 6)
    check_atod("1_0", 14, 8, 0x402c000000000000, 3)
    check_atod("gg", 14, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 14, 8, 0x3fb2492492492492, 2)
    check_atod("1e-5", 14, 0, 0x3ff0000000000000, 1)
    check_atod("ff", 15, 0, 0x7ff8000000000000, 0)
    check_atod("FF", 15, 8, 0x7ff8000000000000, 0)
    check_atod("zz", 15, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 15, 8, 0x0000000000000000, 1)
    check_atod("10", 15, 0, 0x402e000000000000, 2)
    check_atod("1.1", 15, 8, 0x3ff1111111111111, 3)
    check_atod("0.1", 15, 0, 0x3fb1111111111111, 3)
    check_atod("z.z", 15, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 15, 0, 0x406c200000000000, 3)
    check_atod("1p3", 15, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 15, 0, 0x407b600000000000, 3)
    check_atod("-7fffffffffffffff", 15, 8, 0xc01c000000000000, 2)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 15, 0, 0x4f91a312d7fd5819, 65)
    check_atod("0.00001", 15, 8, 0x3eb617ec8bff60dc, 7)
    check_atod("123abc", 15, 0, 0x412aa5b200000000, 6)
    check_atod("1_0", 15, 8, 0x402e000000000000, 3)
    check_atod("gg", 15, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 15, 8, 0x3fb1111111111111, 2)
    check_atod("1e-5", 15, 0, 0x403d000000000000, 2)
    check_atod("ff", 16, 0, 0x406fe00000000000, 2)
    check_atod("FF", 16, 8, 0x406fe00000000000, 2)
    check_atod("zz", 16, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 16, 8, 0x4030000000000000, 4)
    check_atod("10", 16, 0, 0x4030000000000000, 2)
    check_atod("1.1", 16, 8, 0x3ff1000000000000, 3)
    check_atod("0.1", 16, 0, 0x3fb0000000000000, 3)
    check_atod("z.z", 16, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 16, 0, 0x4070000000000000, 3)
    check_atod("1p3", 16, 8, 0x4020000000000000, 3)
    check_atod("1e3", 16, 0, 0x407e300000000000, 3)
    check_atod("-7fffffffffffffff", 16, 8, 0xc3e0000000000000, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 16, 0, 0x4ff1111111111111, 65)
    check_atod("0.00001", 16, 8, 0x3eb0000000000000, 7)
    check_atod("123abc", 16, 0, 0x41323abc00000000, 6)
    check_atod("1_0", 16, 8, 0x4030000000000000, 3)
    check_atod("gg", 16, 0, 0x7ff8000000000000, 0)
    check_atod(".1", 16, 8, 0x3fb0000000000000, 2)
    check_atod("1e-5", 16, 0, 0x403e000000000000, 2)
    check_atod("ff", 17, 0, 0x4070e00000000000, 2)
    check_atod("FF", 17, 8, 0x4070e00000000000, 2)
    check_atod("zz", 17, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 17, 8, 0x0000000000000000, 1)
    check_atod("10", 17, 0, 0x4031000000000000, 2)
    check_atod("1.1", 17, 8, 0x3ff0f0f0f0f0f0f1, 3)
    check_atod("0.1", 17, 0, 0x3fae1e1e1e1e1e1e, 3)
    check_atod("z.z", 17, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 17, 0, 0x4072100000000000, 3)
    check_atod("1p3", 17, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 17, 0, 0x4080900000000000, 3)
    check_atod("-7fffffffffffffff", 17, 8, 0xc3f3b4f5ee2592cb, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 17, 0, 0x5049b988aa99f658, 65)
    check_atod("0.00001", 17, 8, 0x3ea7a1dbe4bd484a, 7)
    check_atod("123abc", 17, 0, 0x41387c7700000000, 6)
    check_atod("1_0", 17, 8, 0x4031000000000000, 3)
    check_atod("gg", 17, 0, 0x4072000000000000, 2)
    check_atod(".1", 17, 8, 0x3fae1e1e1e1e1e1e, 2)
    check_atod("1e-5", 17, 0, 0x403f000000000000, 2)
    check_atod("ff", 18, 0, 0x4071d00000000000, 2)
    check_atod("FF", 18, 8, 0x4071d00000000000, 2)
    check_atod("zz", 18, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 18, 8, 0x0000000000000000, 1)
    check_atod("10", 18, 0, 0x4032000000000000, 2)
    check_atod("1.1", 18, 8, 0x3ff0e38e38e38e39, 3)
    check_atod("0.1", 18, 0, 0x3fac71c71c71c71c, 3)
    check_atod("z.z", 18, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 18, 0, 0x4074400000000000, 3)
    check_atod("1p3", 18, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 18, 0, 0x4082180000000000, 3)
    check_atod("-7fffffffffffffff", 18, 8, 0xc4071019869574e7, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 18, 0, 0x509f1316a3566f9d, 65)
    check_atod("0.00001", 18, 8, 0x3ea1c1fa5f678884, 7)
    check_atod("123abc", 18, 0, 0x41402d8900000000, 6)
    check_atod("1_0", 18, 8, 0x4032000000000000, 3)
    check_atod("gg", 18, 0, 0x4073000000000000, 2)
    check_atod(".1", 18, 8, 0x3fac71c71c71c71c, 2)
    check_atod("1e-5", 18, 0, 0x4040000000000000, 2)
    check_atod("ff", 19, 0, 0x4072c00000000000, 2)
    check_atod("FF", 19, 8, 0x4072c00000000000, 2)
    check_atod("zz", 19, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 19, 8, 0x0000000000000000, 1)
    check_atod("10", 19, 0, 0x4033000000000000, 2)
    check_atod("1.1", 19, 8, 0x3ff0d79435e50d79, 3)
    check_atod("0.1", 19, 0, 0x3faaf286bca1af28, 3)
    check_atod("z.z", 19, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 19, 0, 0x4076900000000000, 3)
    check_atod("1p3", 19, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 19, 0, 0x4083b00000000000, 3)
    check_atod("-7fffffffffffffff", 19, 8, 0xc419c952317c6213, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 19, 0, 0x50eecf8f60dd9398, 65)
    check_atod("0.00001", 19, 8, 0x3e9b1a47c8ece6a5, 7)
    check_atod("123abc", 19, 0, 0x414510de80000000, 6)
    check_atod("1_0", 19, 8, 0x4033000000000000, 3)
    check_atod("gg", 19, 0, 0x4074000000000000, 2)
    check_atod(".1", 19, 8, 0x3faaf286bca1af28, 2)
    check_atod("1e-5", 19, 0, 0x4040800000000000, 2)
    check_atod("ff", 20, 0, 0x4073b00000000000, 2)
    check_atod("FF", 20, 8, 0x4073b00000000000, 2)
    check_atod("zz", 20, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 20, 8, 0x0000000000000000, 1)
    check_atod("10", 20, 0, 0x4034000000000000, 2)
    check_atod("1.1", 20, 8, 0x3ff0cccccccccccd, 3)
    check_atod("0.1", 20, 0, 0x3fa999999999999a, 3)
    check_atod("z.z", 20, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 20, 0, 0x4079000000000000, 3)
    check_atod("1p3", 20, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 20, 0, 0x4085580000000000, 3)
    check_atod("-7fffffffffffffff", 20, 8, 0xc42bac7c2bef435e, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 20, 0, 0x5139968ada942f88, 65)
    check_atod("0.00001", 20, 8, 0x3e94f8b588e368f1, 7)
    check_atod("123abc", 20, 0, 0x414b122400000000, 6)
    check_atod("1_0", 20, 8, 0x4034000000000000, 3)
    check_atod("gg", 20, 0, 0x4075000000000000, 2)
    check_atod(".1", 20, 8, 0x3fa999999999999a, 2)

test "js_atod radix 4":
    check_atod("1e-5", 20, 0, 0x4041000000000000, 2)
    check_atod("ff", 21, 0, 0x4074a00000000000, 2)
    check_atod("FF", 21, 8, 0x4074a00000000000, 2)
    check_atod("zz", 21, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 21, 8, 0x0000000000000000, 1)
    check_atod("10", 21, 0, 0x4035000000000000, 2)
    check_atod("1.1", 21, 8, 0x3ff0c30c30c30c31, 3)
    check_atod("0.1", 21, 0, 0x3fa8618618618618, 3)
    check_atod("z.z", 21, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 21, 0, 0x407b900000000000, 3)
    check_atod("1p3", 21, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 21, 0, 0x4087100000000000, 3)
    check_atod("-7fffffffffffffff", 21, 8, 0xc43c9ebff8a22f68, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 21, 0, 0x51821c2085f1b9ec, 65)
    check_atod("0.00001", 21, 8, 0x3e906e8629d2d903, 7)
    check_atod("123abc", 21, 0, 0x41512fe6c0000000, 6)
    check_atod("1_0", 21, 8, 0x4035000000000000, 3)
    check_atod("gg", 21, 0, 0x4076000000000000, 2)
    check_atod(".1", 21, 8, 0x3fa8618618618618, 2)
    check_atod("1e-5", 21, 0, 0x4041800000000000, 2)
    check_atod("ff", 22, 0, 0x4075900000000000, 2)
    check_atod("FF", 22, 8, 0x4075900000000000, 2)
    check_atod("zz", 22, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 22, 8, 0x0000000000000000, 1)
    check_atod("10", 22, 0, 0x4036000000000000, 2)
    check_atod("1.1", 22, 8, 0x3ff0ba2e8ba2e8ba, 3)
    check_atod("0.1", 22, 0, 0x3fa745d1745d1746, 3)
    check_atod("z.z", 22, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 22, 0, 0x407e400000000000, 3)
    check_atod("1p3", 22, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 22, 0, 0x4088d80000000000, 3)
    check_atod("-7fffffffffffffff", 22, 8, 0xc44c9efff2764f7f, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 22, 0, 0x51c62c4f7bc67aeb, 65)
    check_atod("0.00001", 22, 8, 0x3e8a0b17895e3969, 7)
    check_atod("123abc", 22, 0, 0x4155968b80000000, 6)
    check_atod("1_0", 22, 8, 0x4036000000000000, 3)
    check_atod("gg", 22, 0, 0x4077000000000000, 2)
    check_atod(".1", 22, 8, 0x3fa745d1745d1746, 2)
    check_atod("1e-5", 22, 0, 0x4042000000000000, 2)
    check_atod("ff", 23, 0, 0x4076800000000000, 2)
    check_atod("FF", 23, 8, 0x4076800000000000, 2)
    check_atod("zz", 23, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 23, 8, 0x0000000000000000, 1)
    check_atod("10", 23, 0, 0x4037000000000000, 2)
    check_atod("1.1", 23, 8, 0x3ff0b21642c8590b, 3)
    check_atod("0.1", 23, 0, 0x3fa642c8590b2164, 3)
    check_atod("z.z", 23, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 23, 0, 0x4080880000000000, 3)
    check_atod("1p3", 23, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 23, 0, 0x408ab00000000000, 3)
    check_atod("-7fffffffffffffff", 23, 8, 0xc45bc24595fe33db, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 23, 0, 0x5207c972748ebb06, 65)
    check_atod("0.00001", 23, 8, 0x3e84da6500f910f9, 7)
    check_atod("123abc", 23, 0, 0x415ad92040000000, 6)
    check_atod("1_0", 23, 8, 0x4037000000000000, 3)
    check_atod("gg", 23, 0, 0x4078000000000000, 2)
    check_atod(".1", 23, 8, 0x3fa642c8590b2164, 2)
    check_atod("1e-5", 23, 0, 0x4042800000000000, 2)
    check_atod("ff", 24, 0, 0x4077700000000000, 2)
    check_atod("FF", 24, 8, 0x4077700000000000, 2)
    check_atod("zz", 24, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 24, 8, 0x0000000000000000, 1)
    check_atod("10", 24, 0, 0x4038000000000000, 2)
    check_atod("1.1", 24, 8, 0x3ff0aaaaaaaaaaab, 3)
    check_atod("0.1", 24, 0, 0x3fa5555555555555, 3)
    check_atod("z.z", 24, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 24, 0, 0x4082000000000000, 3)
    check_atod("1p3", 24, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 24, 0, 0x408c980000000000, 3)
    check_atod("-7fffffffffffffff", 24, 8, 0xc46a2dae2f4de9bd, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 24, 0, 0x52469c9b7cfcf152, 65)
    check_atod("0.00001", 24, 8, 0x3e80db20a88f4696, 7)
    check_atod("123abc", 24, 0, 0x41608b3280000000, 6)
    check_atod("1_0", 24, 8, 0x4038000000000000, 3)
    check_atod("gg", 24, 0, 0x4079000000000000, 2)
    check_atod(".1", 24, 8, 0x3fa5555555555555, 2)
    check_atod("1e-5", 24, 0, 0x4043000000000000, 2)
    check_atod("ff", 25, 0, 0x4078600000000000, 2)
    check_atod("FF", 25, 8, 0x4078600000000000, 2)
    check_atod("zz", 25, 0, 0x7ff8000000000000, 0)
    check_atod("0x10", 25, 8, 0x0000000000000000, 1)
    check_atod("10", 25, 0, 0x4039000000000000, 2)
    check_atod("1.1", 25, 8, 0x3ff0a3d70a3d70a4, 3)
    check_atod("0.1", 25, 0, 0x3fa47ae147ae147b, 3)
    check_atod("z.z", 25, 8, 0x7ff8000000000000, 0)
    check_atod("1@2", 25, 0, 0x4083880000000000, 3)
    check_atod("1p3", 25, 8, 0x3ff0000000000000, 1)
    check_atod("1e3", 25, 0, 0x408e900000000000, 3)
    check_atod("-7fffffffffffffff", 25, 8, 0xc4780f6d0aed064f, 17)
    check_atod("11111111111111111111111111111111111111111111111111111111111111111", 25, 0, 0x52833c4158e773be, 65)
    check_atod("0.00001", 25, 8, 0x3e7b7cdfd9d7bdbb, 7)
    check_atod("123abc", 25, 0, 0x416437ebe0000000, 6)
    check_atod("1_0", 25, 8, 0x4039000000000000, 3)
    check_atod("gg", 25, 0, 0x407a000000000000, 2)
    check_atod(".1", 25, 8, 0x3fa47ae147ae147b, 2)
    check_atod("1e-5", 25, 0, 0x4043800000000000, 2)
    check_atod("ff", 26, 0, 0x4079500000000000, 2)
    check_atod("FF", 26, 8, 0x4079500000000000, 2)