3 ms·
Oddly, tcl prints 0.30000000000000004 while jimtcl prints 0.3, while with 1/7 both crap out and round it to a simple 0. Edit: Now it does it fine after inputt
by anthk 1y ago
Oddly, tcl prints 0.30000000000000004 while jimtcl prints 0.3, while
with 1/7 both crap out and round it to a simple 0.
Edit: Now it does it fine after inputting floats:
puts [ expr { 1.0/7.0 } ]
Eforth on top of Subleq, a very small and dumb virtual machine:
1 f 7 f f/ f.
0.143 ok
Still, using rationals where possible (and mod operations otherwise) gives a great 'precision', except for irrationals.