Skip to content

Incorrect encoding of binary subnormal floats #1049

@robdockins

Description

@robdockins

Consider

> :m Float
Loading module Cryptol
Loading module Float
Float> fpFromBits (zero#0x1) : Float32
0x8.0p-152

This, I believe, correctly represents the smallest positive 32-bit subnormal floating-point value. However, if we encode this back into bits, we get something else entirely.

Float> fpToBits (0x8.0p-152 : Float32)
0xf5000000
Float> fpToBits (fpFromBits (zero#0x1) : Float32)
0xf5000000

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething not working correctly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions