Le ven. 6 janv. 2023 à 02:18, Alex Herbert <[email protected]> a écrit :
>
> Note there is an isFinite method.
>
> if (!Double.isFinite(x)) {
> ...
>
> The isFinite method is a JVM intrinsic method in JDK 20. It was added
> in JDK 8 so can be used in [math].

Thanks.

>
> PMD rules would also change this to a forEach loop:
>
> > +        for (double x : value) {
> > +            if (!Double.isFinite(x)) {
> > +                throw new NotFiniteNumberException(x);
> > +            }
> > +        }
>
> This does remove the requirement to declare x = val[i] for reuse of x.

Done.

Regards,
Gilles

>> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to