Sonar fix: Replace x != x with Double.isNaN
This commit is contained in:
parent
e97c3288a5
commit
f6fe96b23f
|
@ -288,7 +288,7 @@ public class Dfp implements RealFieldElement<Dfp> {
|
|||
|
||||
if (exponent == 1024) {
|
||||
// infinity or NAN
|
||||
if (x != x) {
|
||||
if (Double.isNaN(x)) {
|
||||
sign = (byte) 1;
|
||||
nans = QNAN;
|
||||
} else if (x < 0) {
|
||||
|
|
|
@ -636,7 +636,7 @@ final class AccurateMathCalc {
|
|||
* @return formatted number
|
||||
*/
|
||||
static String format(double d) {
|
||||
if (d != d) {
|
||||
if (Double.isNaN(d)) {
|
||||
return "Double.NaN,";
|
||||
} else {
|
||||
return ((d >= 0) ? "+" : "") + Double.toString(d) + "d,";
|
||||
|
|
Loading…
Reference in New Issue