|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.meta.java.lang.DoubleSugar
Untamed: A sweetener defining extra messages that may be e-sent to a floating point number.
Field Summary | |
private static double |
AfterMinus3
|
private static long |
Minus3Bits
Detect whether this jvm has a known bug in reporting floating point representation. |
private static boolean |
NegRepBug
|
Constructor Summary | |
private |
DoubleSugar()
prevent instantiation |
Method Summary | |
static boolean |
aboveZero(double self)
Enabled: Used in the expansion of E's ">" operator. |
static double |
abs(double num)
Enabled: |
static double |
acos(double self)
Enabled: |
static double |
add(double self,
double arg)
Enabled: |
static double |
approxDivide(double self,
double arg)
Enabled: Always gives back a double This corresponds to the Java floating-point "/" operator and the E "/" operator. |
static double |
asin(double self)
Enabled: |
static double |
atan(double self)
Enabled: |
static double |
atan2(double self,
double arg)
Enabled: |
static boolean |
atLeastZero(double self)
Enabled: Used in the expansion of E's ">=" operator. |
static boolean |
atMostZero(double self)
Enabled: Used in the expansion of E's "<=" operator. |
static boolean |
belowZero(double self)
Enabled: Used in the expansion of E's "<" operator. |
static BigInteger |
ceil(double self)
Enabled: |
static double |
compareTo(double self,
Object o)
Enabled: Used in the expansion of E's comparison operators. |
static double |
cos(double self)
Enabled: |
static double |
exp(double self)
Enabled: |
static BigInteger |
floor(double self)
Enabled: |
static BigInteger |
floorDivide(double self,
double arg)
Enabled: Always gives an integer, resulting from rounding towards negative infinity, ie, flooring. |
static boolean |
isZero(double self)
Enabled: Used for arithmetic equality. |
static double |
log(double self)
Enabled: |
static double |
max(double self,
double arg)
Enabled: |
static double |
min(double self,
double arg)
Enabled: |
static double |
mod(double self,
double arg)
Enabled: Remainder from the floorDivide operation. |
static double |
modPow(double self,
double exp,
double modulus)
Enabled: |
static double |
multiply(double self,
double arg)
Enabled: |
static double |
negate(double self)
Enabled: |
static double |
next(double self)
Enabled: Infinity.next() == Infinity |
static double |
pow(double self,
double arg)
Enabled: |
static double |
previous(double self)
Enabled: (-Infinity).previous() == -Infinity |
static double |
random(double self)
Enabled: A number randomly chosen between 0 and this number. |
static double |
remainder(double self,
double arg)
Enabled: Remainder from truncDivide operation. |
static BigInteger |
round(double self)
Enabled: |
static double |
sin(double self)
Enabled: |
static double |
sqrt(double self)
Enabled: |
static double |
subtract(double self,
double arg)
Enabled: |
static double |
tan(double self)
Enabled: |
static BigInteger |
truncate(double self)
Enabled: |
static long |
truncDivide(double self,
double arg)
Enabled: Always gives an integer resulting from rounding towards zero, ie, truncating. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long Minus3Bits
private static final double AfterMinus3
private static final boolean NegRepBug
Constructor Detail |
private DoubleSugar()
Method Detail |
public static boolean aboveZero(double self)
public static double abs(double num)
public static double acos(double self)
public static double add(double self, double arg)
public static double approxDivide(double self, double arg)
public static double asin(double self)
public static double atan(double self)
public static double atan2(double self, double arg)
public static boolean atLeastZero(double self)
public static boolean atMostZero(double self)
public static boolean belowZero(double self)
public static BigInteger ceil(double self)
public static double compareTo(double self, Object o)
public static double cos(double self)
public static double exp(double self)
public static BigInteger floor(double self)
public static BigInteger floorDivide(double self, double arg)
public static boolean isZero(double self)
public static double log(double self)
public static double max(double self, double arg)
public static double min(double self, double arg)
public static double mod(double self, double arg)
(a floorDivide b)*b + (a modulo b) == a [ 5, 3]: ( 1* 3) + 2 == 5 [ 5,-3]: (-2*-3) + -1 == 5 [-5, 3]: (-2* 3) + 1 == -5 [-5,-3]: ( 1*-3) + -2 == -5
Therefore, if the result is non-zero, the sign of the result must be the same as the sign of b, and so the result ranges from 0 inclusive to b exclusive. This corresponds to the E "%%" operator. When b >= 0, it also corresponds to Java's BigInteger.mod().
public static double modPow(double self, double exp, double modulus)
public static double multiply(double self, double arg)
public static double negate(double self)
public static double pow(double self, double arg)
public static double random(double self)
public static double remainder(double self, double arg)
(a truncDivide b)*b + (a remainder b) == a [ 5, 3]: ( 1* 3) + 2 == 5 [ 5,-3]: (-1*-3) + 2 == 5 [-5, 3]: (-1* 3) + -2 == -5 [-5,-3]: ( 1*-3) + -2 == -5
Therefore, if the result is non-zero, the sign of the result must be the same as the sign of a. This corresponds to the Java and E "%" operator.
public static BigInteger round(double self)
public static double sin(double self)
public static double sqrt(double self)
public static double subtract(double self, double arg)
public static double tan(double self)
public static BigInteger truncate(double self)
public static long truncDivide(double self, double arg)
public static double next(double self)
NaN.next() == NaN
Double.getMAX_VALUE().next() == Infinity
(-Infinity).next() == -(Double.getMAX_VALUE())
otherwise, *num*.next() == *next representable number*
public static double previous(double self)
NaN.previous() == NaN
-(Double.getMAX_VALUE()).previous() == -Infinity
Infinity.previous() == Double.getMAX_VALUE()
otherwise, *num*.previous() == *previous representable number*
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |