Skip to content

Hexadecimal float literal rounding spec vs test #509

@AndrewScheidecker

Description

@AndrewScheidecker

This is asserting that a hexadecimal float literal with too many significand bits is rejected as malformed.

I believe this doesn't match the spec, which implies that a hexadecimal float literal with too many hexits may be accepted with rounding:

The value of a literal must not lie outside the representable range of the corresponding IEEE 754 type (that is, a numeric value must not overflow to ±infinity), but it may be rounded to the nearest representable value.

Note: Rounding can be prevented by using hexadecimal notation with no more significant bits than supported by the required type.

Is the intent for the spec to prohibit rounded hex floats?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions