Skip to content

float32 arithmetics #2652

@kerams

Description

@kerams

Description

Arithmetic operations on a float32 may produce numbers that are only representable as float64.

Repro code

This prints

2.7
2.7

but 2.7 is not a number that is representable as float32. On .NET, the same code prints

2.7
2.700000048f

Doing Math.fround(2.7) in the console returns 2.700000047683716, which corresponds to the .NET float32. Shouldn't all float32 operations, not just literals, be wrapped in an fround?

Related information

  • Fable version: 3.4.10 in the REPL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions