Skip to content
Snippets Groups Projects

strtof(), strtod(): handle NaN and Infinity

Merged Florian Meißner requested to merge t-nil/relibc:functions/strto_float/nan_inf into master

There was a TODO in the source for adding NaN and Inf parsing.

My solution is: after sign parsing, if the input string in lowercase starts with 'nan' respective 'inf', set result to corresponding constant from the underlying rust type

We seem to not have negative NaN support in rust. But I am not sure if that would be needed to satisfy the Standard; I don't think so.

Edited by Florian Meißner

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading