Skip to content

Suggesting signed number range for integer literals is strange #2552

@henrikt-ma

Description

@henrikt-ma

In Integer Literals, we first define the integer literals as being non-negative numbers, mentioning that negative numbers can be obtained by negation of a literal:
https://specification.modelica.org/master/lexical-structure.html

Given that the literals are non-negative, it is strange that the minimal recommended number range covers signed numbers. I'm sure this can be written in a better way.

How about moving the recommended number range into the non-normative part together with the negation of literals?

Is it in our interest to formulate the recommendation so that -2147483648 can be expressed as the negation of an Integer literal? That is, could 2147483648 be an integer (or even Integer) literal even when it can't be stored in an Integer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    decidedA decision has been made (label added before the spec is changed)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions