Skip to content

Precision loss due to numeric conversions #2289

@dwijnand

Description

@dwijnand
Welcome to Scala.next (pre-alpha, git-hash: unknown)  (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val x = 123456789L
val x: Long = 123456789
scala> val y = 0F
val y: Float = 0.0f
scala> x - (if (true) x else y)
val res0: Float = -3.0f

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