[
https://issues.apache.org/jira/browse/NUMBERS-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048329#comment-16048329
]
Amey Jadiye commented on NUMBERS-43:
------------------------------------
here.
{code}
public static float round(float x, int scale, int roundingMethod) {
final float sign = Math.copySign(1f, x);
final float factor = (float) Math.pow(10.0f, scale) * sign;
return (float) roundUnscaled(x * factor, sign, roundingMethod) /
factor; // its calling method which return double.
}
{code}
bq. The point here is rather whether anyone would be using {{float}}s for
computations nowadays.
I think now people are using BigDecimal rather than float and double to _(at
least in finance)_, so should be good to deprecate at this point or completely
remove, your call.
> Remove "round(float)" methods?
> ------------------------------
>
> Key: NUMBERS-43
> URL: https://issues.apache.org/jira/browse/NUMBERS-43
> Project: Commons Numbers
> Issue Type: Wish
> Reporter: Gilles
> Labels: api, float
> Fix For: 1.0
>
>
> In class {{Precision}}, there are methods for rounding {{float}} values, e.g.
> {code:java}
> public static float round(float x, int scale, int roundingMethod) { /* ... */
> }
> {code}
> Is there any use for supporting specific handling of floats (in these times
> where memory is not a scarce resources anymore)?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)