Skip to content

[FIX] round-to-uncertainty ignores rounding mode - #100

Closed
Ants-Aare wants to merge 2 commits into
Mc-Zen:mainfrom
Ants-Aare:uncertainty-rounding-mode
Closed

[FIX] round-to-uncertainty ignores rounding mode#100
Ants-Aare wants to merge 2 commits into
Mc-Zen:mainfrom
Ants-Aare:uncertainty-rounding-mode

Conversation

@Ants-Aare

@Ants-Aare Ants-Aare commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Previously when using follow-uncertainty: true it would interpret the value in uncertainty-precision as significant figures instead of places, even when setting rounding mode to "places". This PR is a suggested fix for this behaviour.

If this is intended behaviour, then I would like to add an additional parameter called uncertainty-mode to be able to specify this manually and use places instead of sig figs. With the current implementation I have to reverse engineer my places value to sig figs, but in the round-to-uncertainty method it converts these sig figs back into places, so it's doing it unnecessarily back and forth.

Let me know if there's a different way of achieving the same result, maybe I'm missing a setting.

@Mc-Zen

Mc-Zen commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Hi, the rounding mode is only for manual rounding while automatic rounding (follow-uncertainty: true) is by design independent. Generally, uncertainties are given with one − or rarer 2 − significant figures which motivates the current behavior.

I'll think about extending the design to include your case, but I'm not sure whether its worth the additional conceptual complexity (with several parameters being named similarly).

@Mc-Zen

Mc-Zen commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Oh, maybe I can let uncertainty -precision accept arguments of the form (places: 4). This would evade my counterarguments.

@Ants-Aare

Ants-Aare commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Oh, maybe I can let uncertainty -precision accept arguments of the form (places: 4). This would evade my counterarguments.

that sounds fine to me, for now I forked zero with the change. I'd like to publish my zero calc package on the universe in the coming weeks, so I'm not sure if I want to ship the fork as part of the package. I think I will wait until zero:0.6.2 comes out and publish it then. I want to keep package versions in sync with zero, so that there's no confusion.

in the meantime I'd love some feedback on the package: https://github.com/Ants-Aare/zero-calc

There are still some rough edges and some edgecases that are not covered, but for the most part it works okay. Do you have feedback on the API? Does it feel zero-y?

the display.method and display.error don't look like I want to and I want to double tripple check everything because people might rely on it and I don't want to be the fault of bad science haha.
The variable isolation just does a search for the variable and then does all the inverse operations, it's not a fully implemented solver, so more complex equations are not supported, even the same variable in two different places won't work. For me that's enough, but maybe someone can do a PR for a better solver.

@Mc-Zen

Mc-Zen commented Jul 31, 2026

Copy link
Copy Markdown
Owner

I think I will wait until zero:0.6.2 comes out and publish it then. I want to keep package versions in sync with zero, so that there's no confusion.

I think you can wait for 0.7.0, I will make a release very soon.

in the meantime I'd love some feedback on the package: https://github.com/Ants-Aare/zero-calc

Thank you I will take a look at it

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.

2 participants