Summing large Time instance results in ArgumentError: precision (22) too high
Issue #1
resolved
When trying to perform an addition of two Time variables:
t2 += t1, where t2 & t1 are 9600 seconds & 9300 seconds respectively, the precision throws an argumentError because the precision is too high.
Is this a bug? Or what should I do in this case? Manually setting the precision to 21 results in tests failing with one-off errors.
Comments (4)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed version
Removing version: 0.x.x (automated comment)
-
repo owner - Log in to comment
Thank you for reporting!
Yes, I would consider this a bug - your inputs are nowhere near the precision limit, so it seems reasonable to assume that a simple addition would not put you over.
I will cap the limit to the maximum allowed for addition operations like these. This may, unfortunately, surprise some users who are using the maximum precision values and perform an addition, expecting the precision to rise, e.g.:
Any users who are near the limit would also experience the issue you’ve reported, so correcting this will not break anything that isn’t already broken.
Version 2.1.1 (available now) prevents the precision cap from being breached through addition operations such as these.