Skip Menu |

This queue is for tickets about the Math-Round CPAN distribution.

Report information
The Basics
Id: 74621
Status: open
Priority: 0/
Queue: Math-Round

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.06
Fixed in: (no value)



Subject: Feature request: unround to give range of values
Given a rounded value, what can you say about the original unrounded value? If you know the precision it was rounded to then you can give a lower and upper bound. range_giving_nearest(TARGET, NUMBER) = (LOWER, UPPER) such that nearest(TARGET, x) = NUMBER for all LOWER <= x <= UPPER and nearest(TARGET, y) != NUMBER for all y < LOWER or UPPER < y This can be very useful for checking the results of calculations, when you have a rounded figure to check against.
Actually a half-closed interval makes more sense, since 0.5 is rounded up: nearest(TARGET, x) = NUMBER for all LOWER <= x < UPPER nearest(TARGET, y) != NUMBER for all y < LOWER or UPPER <= y