tinygo/testdata/float.txt
Nia Weiss a867b56e5f compiler: saturate float-to-int conversions
This works around some UB in LLVM, where an out-of-bounds conversion would produce a poison value.
The selected behavior is saturating, except that NaN is mapped to the minimum value.
2021-01-16 19:12:36 +01:00

35 строки
1 005 Б
Text

+3.141593e+000
+6.666667e-001
+1.666667e+000
-3.333333e-001
+1.333333e+000
+3.333333e-001
+6.666667e-001
+1.666667e+000
-3.333333e-001
+1.333333e+000
+3.333333e-001
+6.666667e-001
+6.666667e-001
3 5 -2 -11 0 255 -128 127 0 -128
+5.300000e+001 -8.000000e+000 +2.000000e+001
(+6.666667e-001+1.200000e+000i)
+6.666667e-001
+1.200000e+000
(+6.666667e-001-2.000000e+000i)
+6.666667e-001
-2.000000e+000
(+2.000000e+000+1.000000e+000i)
(+2.000000e+000-2.000000e+000i)
(+6.666667e-001-2.000000e+000i)
(+6.666667e-001+1.200000e+000i)
complex64 add: (+2.000000e+000+1.000000e+001i)
complex64 sub: (+8.000000e+000+1.000000e+001i)
complex64 mul: (-1.500000e+001+2.000000e+000i)
complex64 div: (-1.666667e+000+7.333333e+000i)
complex64 neg: (-5.000000e+000-2.000000e+000i)
complex128 add: (-3.000000e+000+8.000000e+000i)
complex128 sub: (-7.000000e+000+8.000000e+000i)
complex128 mul: (-1.000000e+001+1.000000e+001i)
complex128 div: (-2.500000e+000+7.000000e+000i)
complex128 neg: (+5.000000e+000-2.000000e+000i)