Skip to content

Primitive operations on Long with Float argument have different semantics from Java #5441

@densh

Description

@densh

Scala 2's primitive binary operations on Long that take Float (e.g. (x: Long) % (y: Float)) as an argument erroneously perform an operation in double precision, instead of float precision. This is inconsistent wrt Java semantics. Given that dotty reuses Scala 2's backend I expect it to have the same issue.

More details on reproduction here: scala/bug#11253

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions