ref: 6fb7d34b848c598e6398f960dc0a7e240e09a6f5
dir: /lib/math/test/fpmath-trunc-impl.myr/
use std use math use testr const main = { testr.run([ [.name = "trunc-01", .fn = trunc01], [.name = "trunc-02", .fn = trunc02], [.name = "floor-01", .fn = floor01], [.name = "floor-02", .fn = floor02], [.name = "ceil-01", .fn = ceil01], [.name = "ceil-02", .fn = ceil02], ][:]) } const trunc01 = {c var flt32s : (flt32, flt32)[:] = [ (0.0, 0.0), (-0.0, -0.0), (1.0, 1.0), (1.1, 1.0), (0.9, 0.0), (10664524000000000000.0, 10664524000000000000.0), (-3.5, -3.0), (101.999, 101.0), (std.flt32nan(), std.flt32nan()), ][:] for (f, g) : flt32s testr.eq(c, math.trunc(f), g) ;; } const trunc02 = {c var flt64s : (flt64, flt64)[:] = [ (0.0, 0.0), (-0.0, -0.0), (1.0, 1.0), (1.1, 1.0), (0.9, 0.0), (13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0, 13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0), (-3.5, -3.0), (101.999, 101.0), (std.flt64nan(), std.flt64nan()), ][:] for (f, g) : flt64s testr.eq(c, math.trunc(f), g) ;; } const floor01 = {c var flt32s : (flt32, flt32)[:] = [ (0.0, 0.0), (-0.0, -0.0), (0.5, 0.0), (1.1, 1.0), (10664524000000000000.0, 10664524000000000000.0), (-3.5, -4.0), (-101.999, -102.0), (std.flt32nan(), std.flt32nan()), ][:] for (f, g) : flt32s testr.eq(c, math.floor(f), g) ;; } const floor02 = {c var flt64s : (flt64, flt64)[:] = [ (0.0, 0.0), (-0.0, -0.0), (0.5, 0.0), (1.1, 1.0), (13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0, 13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0), (-3.5, -4.0), (-101.999, -102.0), (std.flt64nan(), std.flt64nan()), ][:] for (f, g) : flt64s testr.eq(c, math.floor(f), g) ;; } const ceil01 = {c var flt32s : (flt32, flt32)[:] = [ (0.0, 0.0), (-0.0, -0.0), (0.5, 1.0), (-0.1, -0.0), (1.1, 2.0), (10664524000000000000.0, 10664524000000000000.0), (-3.5, -3.0), (-101.999, -101.0), (std.flt32nan(), std.flt32nan()), ][:] for (f, g) : flt32s testr.eq(c, math.ceil(f), g) ;; } const ceil02 = {c var flt64s : (flt64, flt64)[:] = [ (0.0, 0.0), (-0.0, -0.0), (0.5, 1.0), (-0.1, -0.0), (1.1, 2.0), (13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0, 13809453812721350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0), (-3.5, -3.0), (-101.999, -101.0), (std.flt64nan(), std.flt64nan()), ][:] for (f, g) : flt64s testr.eq(c, math.ceil(f), g) ;; }