File:  [parser3project] / parser3 / tests / 446.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sun Aug 31 19:53:58 2025 UTC (12 months, 1 week ago) by moko
Branches: MAIN
CVS tags: HEAD
tests for ^math:eq(a;b[;max URL distance]) added (related to feature #1285)

@main[]

$data[^table::create{n1,n2
0.79999999999999993,0.8
-9007199254740992,-9007199254740990
9007199254740992,9007199254740990
9007199254740992,9007199254740994
9007199254740992,9007199254740996
9007199254740992,9007199254740998
9007199254740992,9007199254740999
100000000000000,100000000000000.015625
100000000000000,100000000000000.09375
10000000000000000,10000000000000001
1e-14,1.0000000000000001e-14
1e-14,1.00000000000001e-14
1e+308,1.0000000000000002e+308
1e+308,1.000000000000001e+308
1,1.0000000000000002
1,1.000000000000001
-1,-1.0000000000000002
0,5e-324
0,5e-323}[ $.separator[,] ]]

^for[i](0;4){
    ^cmp[$i]
}


@cmp[max_ulp]
============ Max ULP distance: $max_ulp
^data.menu{ $n1($data.n1) $n2($data.n2)
    ^n1.format[%0.20g] ($data.n1) ^if(^math:eq($n1;$n2;$max_ulp)){==}{!=} ^n2.format[%0.20g] ($data.n2)
}

E-mail: