--- parser3/tests/422.html 2023/11/16 01:33:09 1.1 +++ parser3/tests/422.html 2026/01/07 18:47:31 1.3 @@ -1,4 +1,7 @@ @main[] + +Parser3 with ^if($math:int_max > 0x100000000){wide int (int53)}{32-bit int} + ^show(2000000000) ^show(4000000000) ^show(5000000000) @@ -6,6 +9,44 @@ ^show(-4000000000) ^show(-5000000000) +^show(-1) +^show(-2) + +^show($math:int_max-1) +^show($math:int_max) +^show($math:int_max+1) + +^show($math:int_min-1) +^show($math:int_min) +^show($math:int_min+1) + +$n(10000000000000000) + +n:$n (clipped 0x^n.format[%x]) + +1. % ^eval($n % ($n-1)) + +2. \ ^eval($n \ ($n/1000)) + +3. ~ ^eval(~$n)[%x] + +4. >> ^eval($n >> 16 )[%x] + +5. << ^eval($n << 16 )[%x] (^eval($n << 16 )) + +6. % ^eval(1 % 0.3) + +7. mod ^n.mod($n-10) $n - out of double precision, but works + +8. $i(10) $i(^i.int[]) + mod ^i.mod(4.8) $i + +9. $n(10) + mod ^n.mod(4.8) $n + + $d[^date::now[]] +10. wide int.as_int overflow, exception : ^try-catch{ $d.year($math:int_max) } +11. double.as_int overflow, no exception : ^try-catch{ $d.year($math:int_max+1) } @show[n] ${n}: ^n.format[%d] ^n.format[%u] ^n.format[%x]