Looks right.

Is strict equality correct in the first case? or should that be x <= -1?

On Sat, Aug 4, 2012 at 5:33 PM, Gilles Sadowski <
gil...@harfang.homelinux.org> wrote:

> Hi.
>
> I notice this code at the top of "FastMath.log1p":
> ---CUT---
>         if (x == -1) {
>             return x/0.0;   // -Infinity
>         }
>
>         if (x > 0 && 1/x == 0) { // x = Infinity
>             return x;
>         }
>  ---CUT---
>
> which I'm tempted to rewrite as:
> ---CUT---
>         if (x == -1) {
>             return Double.NEGATIVE_INFINITY;
>         }
>
>         if (x == Double.POSITIVE_INFINITY) {
>             return Double.POSITIVE_INFINITY;
>         }
> ---CUT---
>
> Any objection?
>
>
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to