Граф коммитов

5 коммитов

Автор SHA1 Сообщение Дата
Federico G. Schwindt
ea36fea5a9 Add support for printing slices via print/println
With help from @aykevl.
2022-07-13 14:44:23 +02:00
Ayke van Laethem
431e51b8a0 runtime: use dedicated printfloat32
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.
2020-10-02 11:26:22 +02:00
Ayke van Laethem
9b9b66a09d
compiler: add complex manipulation
* builtins: real, imag, complex
* printing of complex numbers

No support for complex arithmetic yet.
2018-10-22 13:49:03 +02:00
Ayke van Laethem
4731f2f787
testdata: add better tests for struct expanding 2018-09-25 14:24:44 +02:00
Ayke van Laethem
d8f0ddf3fa
main: add tests
Add testing infrastructure and one initial test (for
src/runtime/print.go). More tests to be added later.
2018-09-24 17:24:58 +02:00