
It can be unexpected that printing a float32 involves 64-bit floating point routines, see for example: https://github.com/tinygo-org/tinygo/issues/1415 This commit adds a dedicated printfloat32 instead just for printing float32 values. It comes with a possible code size increase, but only if both float32 and float64 values are printed. Therefore, this should be an improvement in almost all cases. I also tried using printfloat32 for everything (and casting a float64 to float32 to print) but the printed values are slightly different, breaking the testdata/math.go test for example.
23 строки
224 Б
Text
23 строки
224 Б
Text
hello world!
|
|
42
|
|
100000000
|
|
abc
|
|
a b c
|
|
123
|
|
123
|
|
-123
|
|
12345
|
|
12345
|
|
-12345
|
|
12345678
|
|
12345678
|
|
-12345678
|
|
123456789012
|
|
123456789012
|
|
-123456789012
|
|
+3.140000e+000
|
|
+3.140000e+000
|
|
(+5.000000e+000+1.234500e+000i)
|
|
(0:nil)
|
|
map[2]
|
|
true false
|