Dimitrios Efthymiou created NUMBERS-198:
-------------------------------------------
Summary: New function - reverse the digits of a number
Key: NUMBERS-198
URL: https://issues.apache.org/jira/browse/NUMBERS-198
Project: Commons Numbers
Issue Type: New Feature
Components: core
Reporter: Dimitrios Efthymiou
I propose a new function for ArithmeticUtils that takes a number and it returns
the integer closest to it. Some use cases are:
# {*}Rounding Numbers{*}: The most common use case is to perform rounding on
numbers, where you would want to find the closest integer value to a given
number. This is often required when dealing with mathematical or scientific
computations where you want to reduce the precision for simplicity or due to
some limitation.
# {*}Graphics Programming{*}: In computer graphics, you often deal with pixel
values that must be integers. If you're doing any kind of transformation or
computation that results in non-integer values, you might use a function like
this to find the closest integer that can represent a pixel value.
# {*}Discretization{*}: In some fields, it's necessary to transform continuous
data into discrete counterparts for specific algorithms. For instance, in
machine learning or statistical analysis, some algorithms perform better or can
only work with discrete values.
# {*}Data Type Limitations{*}: Sometimes, you're working with a system or
library that only accepts integers. In such cases, a function like this would
be necessary to convert your numbers into a format that the system can
understand.
# {*}Resource Allocation{*}: In resource allocation scenarios, such as
assigning tasks to workers, distributing goods, or scheduling, you often need
to work with whole units. So, you might need to round up or down to the nearest
integer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)