Skip to content

Discrepancies with protoc related to Infinity and NaN in numeric literals #225

@jhump

Description

@jhump

In protoc, -nan is an allowed default value for a double or float field, but protocompile disallows it.

In protoc, float and double values accept inf, infinity, and nan with any kind of capitalization. But protocompile only allows inf and nan and only in lower-case.

Additionally, protoc disallows inf, -inf, nan, and -nan for other double or float options; they're only accepted for field default values. However, I think that is a protoc bug and not behavior we necessarily need to replicate (see protocolbuffers/protobuf#15010).

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