Skip to content

Fix converting octal integers in erfa_generator#281

Merged
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:octal-conversion
Jun 30, 2026
Merged

Fix converting octal integers in erfa_generator#281
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:octal-conversion

Conversation

@eerovaher

Copy link
Copy Markdown
Contributor

The C source code for ERFA tests contains the integer literals 06 and 01. Most people (apparently including the author of 1effd5f) might think that such leading zeros can simply be dropped without changing what the literal represents, but in C the leading zero actually means the integer is written in octal (see also PEP 3127 – Integer Literal Support and Syntax). This has not caused problems in practice because dropping the leading zero happens to work with the values erfa_generator encounters.

The C source code for ERFA tests contains the integer literals `06` and
`01`. Most people (apparently including the author of
1effd5f (Create tests for each function
based on the built-in C tests.)) might think that such leading zeros can
simply be dropped without changing what the literal represents, but in C
the leading zero actually means the integer is written in octal. This
has not caused problems in practice because dropping the leading zero
happens to work with the values `erfa_generator` encounters.
@avalentino avalentino merged commit e70bfb0 into liberfa:main Jun 30, 2026
27 checks passed
@eerovaher eerovaher deleted the octal-conversion branch June 30, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants