Skip to content
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

make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc #18531

Merged
merged 11 commits into from
Jul 20, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jul 19, 2021

other (but related)

  • the code is now cleaner, mFloatToStr was removed, all the float to string logic was moved to formatfloat instead of being spread over many places
  • lots of tests added to tests/float/tfloats.nim
  • cgen now generates roundtrip literals instead of using c_snprintf(result.cstring, result.len.uint, "%#.16e%s", f, literalPostfix.cstring) in toStrMaxPrecision

note

I haven't change the default (introduced in #18504) but changing the default should now be a 1-liner to be put in config/config.nims

@timotheecour timotheecour force-pushed the pr_nimFpRoundtrips_consistent branch from d768c1c to 2c524ab Compare July 20, 2021 06:04
@timotheecour timotheecour force-pushed the pr_nimFpRoundtrips_consistent branch from 2c524ab to 76e2856 Compare July 20, 2021 06:58
@timotheecour timotheecour marked this pull request as ready for review July 20, 2021 07:10
@timotheecour timotheecour changed the title make -d:nimFpRoundtrips work consistently in vm vs rt make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc Jul 20, 2021
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label Jul 20, 2021
@timotheecour timotheecour requested a review from Araq July 20, 2021 19:33
@Araq Araq merged commit cf0cf32 into nim-lang:devel Jul 20, 2021
@timotheecour timotheecour deleted the pr_nimFpRoundtrips_consistent branch July 20, 2021 20:15
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
…8400, etc (nim-lang#18531)

* compiler/vmhooks: add getVar to allow vmops with var params
* addFloat vmops with var param
* cgen now renders float32 literals in c backend using roundtrip float to string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review (please take another look): ready for next review round
Projects
None yet
2 participants