mirror of
https://github.com/irmen/prog8.git
synced 2026-04-26 05:17:54 +00:00
vm: treat floats as 64 bits doubles. 0.0 printed as "0".
This commit is contained in:
@@ -48,10 +48,10 @@ class TestMemory: FunSpec({
|
||||
test("32 bits float access") {
|
||||
val mem = Memory()
|
||||
mem.getFloat(1000) shouldNotBe 0.0
|
||||
mem.setFloat(1000, 0.0f)
|
||||
mem.getFloat(1000) shouldBe 0.0f
|
||||
mem.setFloat(1000, -9.876543f)
|
||||
mem.getFloat(1000) shouldBe -9.876543f
|
||||
mem.setFloat(1000, 0.0)
|
||||
mem.getFloat(1000) shouldBe 0.0
|
||||
mem.setFloat(1000, -9.876543)
|
||||
mem.getFloat(1000) shouldBe -9.876543
|
||||
}
|
||||
|
||||
test("setstring and getstring") {
|
||||
|
||||
@@ -128,6 +128,6 @@ class TestVm: FunSpec( {
|
||||
c64machine.getFloatAsmBytes(Math.PI) shouldBe "\$82, \$49, \$0f, \$da, \$a2"
|
||||
|
||||
val vm = VirtualMachineDefinition()
|
||||
vm.getFloatAsmBytes(Math.PI) shouldBe "\$40, \$49, \$0f, \$db"
|
||||
vm.getFloatAsmBytes(Math.PI) shouldBe "\$40, \$09, \$21, \$fb, \$54, \$44, \$2d, \$18"
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user