File:  [parser3project] / parser3 / tests / 446.html
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Sat Oct 4 16:12:43 2025 UTC (7 months, 3 weeks ago) by moko
Branches: MAIN
CVS tags: HEAD
tests for $n1 eq n2 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]
}
^cmp2[]

@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)
}

@cmp2[]
============ String
^data.menu{ $n1($data.n1) $n2($data.n2)
    ^n1.format[%0.20g] ($data.n1) ^if($n1 eq $n2){==}{!=} ^n2.format[%0.20g] ($data.n2)
}

E-mail: