Skip to content

[Ruby 3.4] String#to_f now accepts a decimal string with decimal part omitted#1287

Merged
andrykonchin merged 1 commit into
masterfrom
ak/add-specs-for-string-to-f
Oct 4, 2025
Merged

[Ruby 3.4] String#to_f now accepts a decimal string with decimal part omitted#1287
andrykonchin merged 1 commit into
masterfrom
ak/add-specs-for-string-to-f

Conversation

@andrykonchin
Copy link
Copy Markdown
Member

Changes:

String#to_f now accepts a decimal string with decimal part omitted. [Feature #20705]
Note that the result changes when an exponent is specified.

Actually the only case that was missing is a one for fixed bug in String#to_f - '1.e-9'.to_f returned 1.0.

@andrykonchin andrykonchin merged commit d36db5f into master Oct 4, 2025
24 checks passed
@andrykonchin andrykonchin deleted the ak/add-specs-for-string-to-f branch October 4, 2025 14:26
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