public class IEEE extends Object
This Java code is based on C code in the package fdlibm, which can be obtained from www.netlib.org. The original fdlibm C code contains the following notice.
Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Developed at SunSoft, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.
Modifier and Type | Method and Description |
---|---|
static double |
copysign(double x,
double y)
Returns a value with the magnitude of x and with the sign bit of y.
|
static boolean |
finite(double x)
Finite number test on an argument of type double.
|
static int |
ilogb(double x)
Return the binary exponent of non-zero x.
|
static boolean |
isNaN(double x)
NaN test on an argument of type double.
|
static double |
nextAfter(double x,
double y)
Returns the next machine floating-point number
next to x in the direction toward y.
|
static double |
scalbn(double x,
int n)
Returns \(x\,2^n\) computed by exponent
manipulation rather than by actually performing an
exponentiation or a multiplication.
|
static boolean |
unordered(double x,
double y)
Unordered test on a pair of
double s. |
public static double copysign(double x, double y)
x
- a double
from which the magnitude will be gleanedy
- a double
from which the sign will be gleaneddouble
value with magnitude x and sign of ypublic static boolean finite(double x)
x
- the double
which is to be testedpublic static boolean isNaN(double x)
x
- the double
which is to be testedpublic static boolean unordered(double x, double y)
double
s. Tests whether
either of a pair of double
s is a NaN.x
- a double
y
- a double
public static double nextAfter(double x, double y)
x
- a double
y
- a double
double
which represents the value
which is closest to x in the interval
bounded by x and ypublic static double scalbn(double x, int n)
x
- a double
n
- an int
representing the power to which
2 is raiseddouble
representing \(x\,2^n\).public static int ilogb(double x)
x
- a double
int
representing the binary exponent of x.
Special cases ilogb(0) = -Integer.MAX_VALUE
and
\({\rm {ilogb}} (\infty) = {\rm {ilogb}} (-\infty) = {\rm {ilogb}} (NaN) = {\rm {Integer.MAX\_VALUE}}\).Integer.MAX_VALUE
Copyright © 2020 Rogue Wave Software. All rights reserved.