Skip to content

Float.round/2 returns invalid value for 5.0e-324 with precision 1 #8685

@hauleth

Description

@hauleth

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
    Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]
    
    Elixir 1.8.0 (compiled with Erlang/OTP 21)
    
  • Operating system:
    Darwin 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
    

Current behavior

refute Float.round(5.0e-324, 1) == 0.0

Expected behavior

assert Float.round(5.0e-324, 1) == 0.0

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