mirror of
https://github.com/irmen/prog8.git
synced 2024-11-23 07:32:10 +00:00
1509de390e
print_f() no longer prints a leading space. Better error message if using float in for loop. Fix crash when using non-const as when choice value. VM print_f() more closely resembles the CBM version.
41 lines
753 B
Lua
41 lines
753 B
Lua
%zeropage basicsafe
|
|
%import floats
|
|
%import textio
|
|
%option no_sysinit
|
|
|
|
main {
|
|
sub start() {
|
|
floats.print_f(0.0)
|
|
txt.nl()
|
|
floats.print_f(1.0)
|
|
txt.nl()
|
|
floats.print_f(11111.0)
|
|
txt.nl()
|
|
floats.print_f(1e10)
|
|
txt.nl()
|
|
floats.print_f(1.234)
|
|
txt.nl()
|
|
floats.print_f(111.234)
|
|
txt.nl()
|
|
floats.print_f(-111.234)
|
|
txt.nl()
|
|
floats.print_f(-111.234)
|
|
txt.nl()
|
|
|
|
uword zz
|
|
const ubyte check = 99
|
|
|
|
when zz {
|
|
1,2,check -> {
|
|
cx16.r0++
|
|
}
|
|
9999 -> {
|
|
cx16.r0++
|
|
}
|
|
else -> {
|
|
cx16.r0++
|
|
}
|
|
}
|
|
}
|
|
}
|