Skip to content

Error in calculating power function #2192

Description

Describe the bug
I calculate a expression in makecode, then send the value to serial port. In simulator it is ok, but in real serial port, it will get wrong number.

let P = 100240
basic.forever(function () {
    serial.writeValue("T", (P / 101325) ** (1 / 5.255))
    basic.pause(1000)
})

In simulator, it will show:

T:0.997953407897062

But in real serial port it will show:

T: 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions