Skip to content

Reject a truncated exponent instead of keeping the coefficient - #199

Open
SashaMIT wants to merge 1 commit into
ericlagergren:masterfrom
SashaMIT:codered-truncated-exponent
Open

SashaMIT wants to merge 1 commit into
ericlagergren:masterfrom
SashaMIT:codered-truncated-exponent

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

  • SetString("1e") returned 1. SetString("1e+") and SetString("1e-") also returned 1, and SetString(".") returned 0. None of them set ConversionSyntax.
  • A truncated exponent, and a lone dot, are now quiet NaNs with ConversionSyntax, which is the same path other rejected numeric strings already take.
  • 1e2, 1e+2, 1e-1, 1., and .5 still parse as before.

Test plan

  • TestSetStringTruncatedNumeric failed on tip: 1e = 1, want NaN
  • The same test passes after the change
  • Parser, format, compare, ceil, and floor tests around this path pass

Made with Cursor

SetString("1e") returned 1, and SetString(".") returned 0, without ConversionSyntax. Those strings are now quiet NaNs, like other rejected numeric strings.
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.

1 participant