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

Fix floating point number representation #251

Merged
merged 5 commits into from
Jan 27, 2025

Conversation

jeparlefrancais
Copy link
Contributor

@jeparlefrancais jeparlefrancais commented Jan 24, 2025

Closes #248

This PR change the inner representation of the decimal numbers to avoid miss-formatting the numbers when printing them back.

I decided to remove the DecimalNumber::get_raw_float method from the public API.

  • add entry to the changelog

Copy link

Coverage after merging fix-float-representation into main will be

86.69%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src/generator
   dense.rs88.63%100%93.33%88.19%1002–1008, 1022–1024, 1042–1046, 1054, 1063–1064, 1069, 1075, 1084–1092, 1109, 1131, 1144–1147, 1151–1154, 159–160, 162, 176–177, 179, 253–265, 267–273, 275–276, 287–289, 368, 417, 50, 507, 51–55, 57–59, 61, 614–616, 62–63, 65–68, 685, 69, 704, 80, 887, 932, 949, 976–983
   mod.rs98.65%100%100%98.55%354, 370, 374
   utils.rs94.44%100%96.55%94.22%137, 31–33, 339, 35, 353–354, 37, 370–373, 61, 71, 81
src/nodes/expressions
   mod.rs78.76%100%78.38%78.85%137–139, 143–145, 149–151, 155–157, 161–163, 167–169, 185–187, 191–193, 269, 323, 92–97
   number.rs90.62%100%90.54%90.63%205–209, 211, 221–225, 227–228, 280–284, 286, 317, 320–325, 327, 380
   string.rs95.73%100%92.11%96.43%48, 50, 93–95

@jeparlefrancais jeparlefrancais merged commit 327ced2 into main Jan 27, 2025
6 checks passed
@jeparlefrancais jeparlefrancais deleted the fix-float-representation branch January 27, 2025 02: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.

Numbers truncated resulting in loss of precision
1 participant