[FIX] round-to-uncertainty ignores rounding mode - #100
Conversation
|
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). |
|
Oh, maybe I can let uncertainty -precision accept arguments of the form |
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. |
I think you can wait for 0.7.0, I will make a release very soon.
Thank you I will take a look at it |
Previously when using
follow-uncertainty: trueit would interpret the value inuncertainty-precisionas 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-modeto 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 theround-to-uncertaintymethod 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.