Skip to content

Explicit float to int conversion: rounding rules #5

@resetius

Description

@resetius

Explicit conversion from float to int via int() currently uses C-style truncation:

  • int(-1.5)-1 (C behavior)

Mathematically correct behavior (and Kumir behavior) should be rounding towards negative infinity:

  • int(-1.5)-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions