|
JML | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmlspecs.models.JMLMath
A JML class that implements methods equivalent to those available in
Math
but that are defined over \bigint
and
\real
instead.
Class Specifications |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT; public represents _getClass <- \typeof(this); |
Model Field Summary |
Model fields inherited from class java.lang.Object |
_getClass, objectState, theString |
Ghost Field Summary |
Ghost fields inherited from class java.lang.Object |
objectTimesFinalized, owner |
Constructor Summary | |
private |
JMLMath()
Don't let anyone instantiate this class. |
Model Method Summary | |
static \bigint |
abs(\bigint a)
Returns the absolute value of a \bigint value. |
static \real |
abs(\real a)
Returns the absolute value of a \real value. |
static \real |
ceil(\real a)
Returns the smallest (closest to negative infinity) \real value that is not less than the argument and is
equal to a mathematical integer. |
static \real |
floor(\real a)
Returns the largest (closest to positive infinity) \real value that is not greater than the argument and
is equal to a mathematical integer. |
static \bigint |
max(\bigint a,
\bigint b)
Returns the greater of two \bigint values. |
static \real |
max(\real a,
\real b)
Returns the greater of two \real values. |
static \bigint |
min(\bigint a,
\bigint b)
Returns the smaller of two int values. |
static \real |
min(\real a,
\real b)
Returns the smaller of two \real values. |
static \bigint |
nearestInteger(\real a)
|
static \real |
pow(\real a,
\real b)
Returns of value of the first argument raised to the power of the second argument. |
static \real |
rint(\real a)
Returns the \real value that is closest in value
to the argument and is equal to a mathematical integer. |
static \bigint |
round(\real a)
Returns the closest \bigint to the argument. |
static \real |
sqrt(\real a)
The \real value that is closer than any other to
e, the base of the natural logarithms. ! |
Model methods inherited from class java.lang.Object |
hashValue |
Method Summary |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private JMLMath()
Model Method Detail |
public static \real sqrt(\real a)
\real
value that is closer than any other to
e, the base of the natural logarithms. !FIXME! define exactly.
The \real
value that is closer than any other to
pi, the ratio of the circumference of a circle to its
diameter. !FIXME! define exactly.
Returns the correctly rounded positive square root of a
\real
value.
a
- a value.
a
.public static \real ceil(\real a)
\real
value that is not less than the argument and is
equal to a mathematical integer.
a
- a value.
\real
value that is not less than the argument
and is equal to a mathematical integer. public static \real floor(\real a)
\real
value that is not greater than the argument and
is equal to a mathematical integer.
a
- a value.
\real
value that is not greater than the argument
and is equal to a mathematical integer. public static \real rint(\real a)
\real
value that is closest in value
to the argument and is equal to a mathematical integer. If two
\real
values that are mathematical integers are
equally close, the result is the integer value that is
even.
a
- a \real
value.
\real
value to a
that is
equal to a mathematical integer.public static \bigint nearestInteger(\real a)
public static \real pow(\real a, \real b)
a
- the base.b
- the exponent.
ab
.public static \bigint round(\real a)
\bigint
to the argument. The result is
equal to the value of the expression:
JMLMath.floor(a + 0.5d)
a
- a \real
value.
\bigint
value, i.e. JMLMath.floor(a + 0.5d).
public static \bigint abs(\bigint a)
\bigint
value.
If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned.
a
- the argument whose absolute value is to be determined
public static \real abs(\real a)
\real
value.
If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned.
a
- the argument whose absolute value is to be determined
public static \bigint max(\bigint a, \bigint b)
\bigint
values.
a
- an argument.b
- another argument.
a
and b
.public static \real max(\real a, \real b)
\real
values.
a
- an argument.b
- another argument.
a
and b
.public static \bigint min(\bigint a, \bigint b)
int
values.
a
- an argument.b
- another argument.
a
and b
.public static \real min(\real a, \real b)
\real
values.
a
- an argument.b
- another argument.
a
and b
.
|
JML | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |