|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.scheme.SExpr
org.rubato.scheme.SNumber
org.rubato.scheme.SRational
public final class SRational
The class of rational values.
Field Summary |
---|
Fields inherited from class org.rubato.scheme.SExpr |
---|
NULL, VOID |
Method Summary | |
---|---|
SNumber |
abs()
Returns the absolute value of this number. |
SNumber |
acos()
Returns the arccosine of this number. |
SNumber |
add(SComplex n)
Returns the sum of this number and complex number n . |
SNumber |
add(SInteger n)
Returns the sum of this number and integer n . |
SNumber |
add(SNumber n)
Returns the sum of this number and number n . |
SNumber |
add(SRational n)
Returns the sum of this number and rational number n . |
SNumber |
add(SReal n)
Returns the sum of this number and real number n . |
SNumber |
angle()
Returns the angle of this number. |
SNumber |
asin()
Returns the arcsine of this number. |
SNumber |
atan(SNumber n)
Returns the arctangent of this number. |
SNumber |
ceiling()
Returns the ceiling of this number. |
SNumber |
cos()
Returns the cosine of this number. |
java.lang.String |
display()
Returns a string representation of this SExpr. |
SNumber |
divide(SNumber n)
Returns the quotient of this number by the number n . |
SNumber |
divideInto(SComplex n)
Returns the quotient of the complex number n by this number. |
SNumber |
divideInto(SInteger n)
Returns the quotient of the integer n by this number. |
SNumber |
divideInto(SRational n)
Returns the quotient of the rational n by this number. |
SNumber |
divideInto(SReal n)
Returns the quotient of the real number n by this number. |
boolean |
eq_p(SExpr sexpr)
Returns true iff this is equal to sexpr in the eq? sense. |
boolean |
equal_p(SExpr sexpr)
Returns true iff this is equal to sexpr in the equal? sense. |
boolean |
equals(java.lang.Object obj)
Returns true iff this is equal to obj . |
boolean |
eqv_p(SExpr sexpr)
Returns true iff this is equal to sexpr in the eqv? sense. |
SNumber |
exp()
Returns e^(this number). |
SNumber |
expt(SNumber n)
Returns (this number)^ n . |
SNumber |
floor()
Returns the floor of this number. |
Rational |
getRational()
Returns the rational number in this Scheme value. |
SNumber |
imagPart()
Returns the imaginary part of this number. |
boolean |
isRational()
Returns true iff this is a rational. |
SNumber |
log()
Returns the natural logarithm of this number. |
static SNumber |
make(Rational q)
Creates a Scheme value from the rational number q . |
SNumber |
multiply(SComplex n)
Returns the product of this number and the complex number n . |
SNumber |
multiply(SInteger n)
Returns the product of this number and the integer n . |
SNumber |
multiply(SNumber n)
Returns the product of this number and the number n . |
SNumber |
multiply(SRational n)
Returns the product of this number and the rational n . |
SNumber |
multiply(SReal n)
Returns the product of this number and the real number n . |
SNumber |
neg()
Returns the negative of this number. |
boolean |
negative_p()
Returns true iff this number is negative. |
boolean |
positive_p()
Returns true iff this number is positive. |
SNumber |
realPart()
Returns the real part of this number. |
SNumber |
round()
Returns this number rounded. |
SNumber |
sin()
Returns the sine of this number. |
SNumber |
sqrt()
Returns the square root of this number. |
SNumber |
subtract(SNumber n)
Returns the difference of this number and number n . |
SNumber |
subtractFrom(SComplex n)
Returns the difference of the complex number n and this number. |
SNumber |
subtractFrom(SInteger n)
Returns the difference of the integer n and this number. |
SNumber |
subtractFrom(SRational n)
Returns the difference of the rational n and this number. |
SNumber |
subtractFrom(SReal n)
Returns the difference of the real number n and this number. |
SNumber |
tan()
Returns the tangent of this number. |
SNumber |
toInexact()
Returns this number converted to an inexact value. |
SReal |
toReal()
Returns this number converted to a real number. |
java.lang.String |
toString()
Returns a string representation of this SExpr. |
SNumber |
truncate()
Returns this number truncated. |
boolean |
zero_p()
Returns true iff this number is zero. |
Methods inherited from class org.rubato.scheme.SNumber |
---|
isNumber |
Methods inherited from class org.rubato.scheme.SExpr |
---|
car, cdr, cons, getCar, getCdr, getLength, isBoolean, isChar, isClosure, isComplex, isCons, isDenotator, isForm, isInteger, isList, isNull, isPair, isPrimitive, isReal, isString, isSymbol, isVector, isVoid, nth, setCar, setCdr |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static SNumber make(Rational q)
q
.
public boolean eq_p(SExpr sexpr)
SExpr
sexpr
in the eq? sense.
eq_p
in class SExpr
public boolean eqv_p(SExpr sexpr)
SExpr
sexpr
in the eqv? sense.
eqv_p
in class SExpr
public boolean equal_p(SExpr sexpr)
SExpr
sexpr
in the equal? sense.
equal_p
in class SExpr
public boolean equals(java.lang.Object obj)
SExpr
obj
. Normally this
returns the same result as SExpr.equal_p(org.rubato.scheme.SExpr)
.
equals
in class SExpr
public boolean isRational()
SExpr
isRational
in class SExpr
public SNumber add(SNumber n)
SNumber
n
.
add
in class SNumber
public SNumber add(SInteger n)
SNumber
n
.
add
in class SNumber
public SNumber add(SRational n)
SNumber
n
.
add
in class SNumber
public SNumber add(SReal n)
SNumber
n
.
add
in class SNumber
public SNumber add(SComplex n)
SNumber
n
.
add
in class SNumber
public SNumber subtract(SNumber n)
SNumber
n
.
subtract
in class SNumber
public SNumber subtractFrom(SInteger n)
SNumber
n
and this number.
subtractFrom
in class SNumber
public SNumber subtractFrom(SRational n)
SNumber
n
and this number.
subtractFrom
in class SNumber
public SNumber subtractFrom(SReal n)
SNumber
n
and this number.
subtractFrom
in class SNumber
public SNumber subtractFrom(SComplex n)
SNumber
n
and this number.
subtractFrom
in class SNumber
public SNumber multiply(SNumber n)
SNumber
n
.
multiply
in class SNumber
public SNumber multiply(SInteger n)
SNumber
n
.
multiply
in class SNumber
public SNumber multiply(SRational n)
SNumber
n
.
multiply
in class SNumber
public SNumber multiply(SReal n)
SNumber
n
.
multiply
in class SNumber
public SNumber multiply(SComplex n)
SNumber
n
.
multiply
in class SNumber
public SNumber divide(SNumber n)
SNumber
n
.
divide
in class SNumber
public SNumber divideInto(SInteger n)
SNumber
n
by this number.
divideInto
in class SNumber
public SNumber divideInto(SRational n)
SNumber
n
by this number.
divideInto
in class SNumber
public SNumber divideInto(SReal n)
SNumber
n
by this number.
divideInto
in class SNumber
public SNumber divideInto(SComplex n)
SNumber
n
by this number.
divideInto
in class SNumber
public SNumber neg()
SNumber
neg
in class SNumber
public SNumber abs()
SNumber
abs
in class SNumber
public SNumber acos()
SNumber
acos
in class SNumber
public SNumber asin()
SNumber
asin
in class SNumber
public SNumber atan(SNumber n)
SNumber
atan
in class SNumber
public SNumber ceiling()
SNumber
ceiling
in class SNumber
public SNumber cos()
SNumber
cos
in class SNumber
public SNumber exp()
SNumber
exp
in class SNumber
public SNumber floor()
SNumber
floor
in class SNumber
public SNumber log()
SNumber
log
in class SNumber
public SNumber round()
SNumber
round
in class SNumber
public SNumber sin()
SNumber
sin
in class SNumber
public SNumber tan()
SNumber
tan
in class SNumber
public SNumber truncate()
SNumber
truncate
in class SNumber
public SNumber angle()
SNumber
angle
in class SNumber
public SNumber expt(SNumber n)
SNumber
n
.
expt
in class SNumber
public SNumber imagPart()
SNumber
imagPart
in class SNumber
public SNumber realPart()
SNumber
realPart
in class SNumber
public SNumber sqrt()
SNumber
sqrt
in class SNumber
public boolean zero_p()
SNumber
zero_p
in class SNumber
public boolean positive_p()
SNumber
positive_p
in class SNumber
public boolean negative_p()
SNumber
negative_p
in class SNumber
public SReal toReal()
SNumber
toReal
in class SNumber
public SNumber toInexact()
SNumber
toInexact
in class SNumber
public java.lang.String toString()
SExpr
toString
in class SExpr
public java.lang.String display()
SExpr
display
in class SExpr
public Rational getRational()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |