Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: to_num_from_stream pointer position correction #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
jalvesz merged 1 commit into fortran-lang:master from jalvesz:to_num
Jun 9, 2025

Conversation

@jalvesz
Copy link
Contributor

@jalvesz jalvesz commented Jun 8, 2025

This PR fixes the computation of the position in a character stream for the to_num_from_stream function to properly advance when the character is a long chain. Otherwise, negative numbers can be obtained from len(s, lind=int8) if the string is in effect larger than 127.

!----------------------------------------------
call to_num_base(s,v,p,err)
p = min( p , len(s, kind = int8) )
p = min( p , len(s) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As p is declared as integer(int8), similar issues might still happen. Maybe also declare p as integer :: p? Or do you think it is not needed?

Copy link
Contributor Author

@jalvesz jalvesz Jun 8, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed as the kind is converted as an output of min. It could happen if an individual number is written on more than 127 characters. But even a quad number would fit.

jvdp1 reacted with thumbs up emoji
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jalvesz . LGTM. See my suggestion below.

@jalvesz jalvesz merged commit 25f94a9 into fortran-lang:master Jun 9, 2025
16 checks passed
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 9, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
@jalvesz jalvesz deleted the to_num branch June 10, 2025 09:45
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 10, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jun 30, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
github-actions bot added a commit to banana-bred/stdlib that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@perazz perazz perazz approved these changes

@jvdp1 jvdp1 jvdp1 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /