org.rubato.scheme
Class SNumber

java.lang.Object
  extended by org.rubato.scheme.SExpr
      extended by org.rubato.scheme.SNumber
Direct Known Subclasses:
SComplex, SInteger, SRational, SReal

public abstract class SNumber
extends SExpr

The base class of all numerical values.

Author:
Gérard Milmeister

Field Summary
 
Fields inherited from class org.rubato.scheme.SExpr
NULL, VOID
 
Method Summary
abstract  SNumber abs()
          Returns the absolute value of this number.
abstract  SNumber acos()
          Returns the arccosine of this number.
abstract  SNumber add(SComplex n)
          Returns the sum of this number and complex number n.
abstract  SNumber add(SInteger n)
          Returns the sum of this number and integer n.
abstract  SNumber add(SNumber n)
          Returns the sum of this number and number n.
abstract  SNumber add(SRational n)
          Returns the sum of this number and rational number n.
abstract  SNumber add(SReal n)
          Returns the sum of this number and real number n.
abstract  SNumber angle()
          Returns the angle of this number.
abstract  SNumber asin()
          Returns the arcsine of this number.
abstract  SNumber atan(SNumber n)
          Returns the arctangent of this number.
abstract  SNumber ceiling()
          Returns the ceiling of this number.
abstract  SNumber cos()
          Returns the cosine of this number.
abstract  SNumber divide(SNumber n)
          Returns the quotient of this number by the number n.
abstract  SNumber divideInto(SComplex n)
          Returns the quotient of the complex number n by this number.
abstract  SNumber divideInto(SInteger n)
          Returns the quotient of the integer n by this number.
abstract  SNumber divideInto(SRational n)
          Returns the quotient of the rational n by this number.
abstract  SNumber divideInto(SReal n)
          Returns the quotient of the real number n by this number.
abstract  SNumber exp()
          Returns e^(this number).
abstract  SNumber expt(SNumber n)
          Returns (this number)^n.
abstract  SNumber floor()
          Returns the floor of this number.
abstract  SNumber imagPart()
          Returns the imaginary part of this number.
 boolean isNumber()
          Returns true iff this is a number.
abstract  SNumber log()
          Returns the natural logarithm of this number.
abstract  SNumber multiply(SComplex n)
          Returns the product of this number and the complex number n.
abstract  SNumber multiply(SInteger n)
          Returns the product of this number and the integer n.
abstract  SNumber multiply(SNumber n)
          Returns the product of this number and the number n.
abstract  SNumber multiply(SRational n)
          Returns the product of this number and the rational n.
abstract  SNumber multiply(SReal n)
          Returns the product of this number and the real number n.
abstract  SNumber neg()
          Returns the negative of this number.
abstract  boolean negative_p()
          Returns true iff this number is negative.
abstract  boolean positive_p()
          Returns true iff this number is positive.
abstract  SNumber realPart()
          Returns the real part of this number.
abstract  SNumber round()
          Returns this number rounded.
abstract  SNumber sin()
          Returns the sine of this number.
abstract  SNumber sqrt()
          Returns the square root of this number.
abstract  SNumber subtract(SNumber n)
          Returns the difference of this number and number n.
abstract  SNumber subtractFrom(SComplex n)
          Returns the difference of the complex number n and this number.
abstract  SNumber subtractFrom(SInteger n)
          Returns the difference of the integer n and this number.
abstract  SNumber subtractFrom(SRational n)
          Returns the difference of the rational n and this number.
abstract  SNumber subtractFrom(SReal n)
          Returns the difference of the real number n and this number.
abstract  SNumber tan()
          Returns the tangent of this number.
abstract  SNumber toInexact()
          Returns this number converted to an inexact value.
abstract  SReal toReal()
          Returns this number converted to a real number.
abstract  SNumber truncate()
          Returns this number truncated.
abstract  boolean zero_p()
          Returns true iff this number is zero.
 
Methods inherited from class org.rubato.scheme.SExpr
car, cdr, cons, display, eq_p, equal_p, equals, eqv_p, getCar, getCdr, getLength, isBoolean, isChar, isClosure, isComplex, isCons, isDenotator, isForm, isInteger, isList, isNull, isPair, isPrimitive, isRational, isReal, isString, isSymbol, isVector, isVoid, nth, setCar, setCdr, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isNumber

public boolean isNumber()
Description copied from class: SExpr
Returns true iff this is a number.

Overrides:
isNumber in class SExpr

add

public abstract SNumber add(SNumber n)
Returns the sum of this number and number n.


add

public abstract SNumber add(SInteger n)
Returns the sum of this number and integer n.


add

public abstract SNumber add(SRational n)
Returns the sum of this number and rational number n.


add

public abstract SNumber add(SReal n)
Returns the sum of this number and real number n.


add

public abstract SNumber add(SComplex n)
Returns the sum of this number and complex number n.


subtract

public abstract SNumber subtract(SNumber n)
Returns the difference of this number and number n.


subtractFrom

public abstract SNumber subtractFrom(SInteger n)
Returns the difference of the integer n and this number.


subtractFrom

public abstract SNumber subtractFrom(SRational n)
Returns the difference of the rational n and this number.


subtractFrom

public abstract SNumber subtractFrom(SReal n)
Returns the difference of the real number n and this number.


subtractFrom

public abstract SNumber subtractFrom(SComplex n)
Returns the difference of the complex number n and this number.


multiply

public abstract SNumber multiply(SNumber n)
Returns the product of this number and the number n.


multiply

public abstract SNumber multiply(SInteger n)
Returns the product of this number and the integer n.


multiply

public abstract SNumber multiply(SRational n)
Returns the product of this number and the rational n.


multiply

public abstract SNumber multiply(SReal n)
Returns the product of this number and the real number n.


multiply

public abstract SNumber multiply(SComplex n)
Returns the product of this number and the complex number n.


divide

public abstract SNumber divide(SNumber n)
Returns the quotient of this number by the number n.


divideInto

public abstract SNumber divideInto(SInteger n)
Returns the quotient of the integer n by this number.


divideInto

public abstract SNumber divideInto(SRational n)
Returns the quotient of the rational n by this number.


divideInto

public abstract SNumber divideInto(SReal n)
Returns the quotient of the real number n by this number.


divideInto

public abstract SNumber divideInto(SComplex n)
Returns the quotient of the complex number n by this number.


neg

public abstract SNumber neg()
Returns the negative of this number.


abs

public abstract SNumber abs()
Returns the absolute value of this number.


zero_p

public abstract boolean zero_p()
Returns true iff this number is zero.


positive_p

public abstract boolean positive_p()
Returns true iff this number is positive.


negative_p

public abstract boolean negative_p()
Returns true iff this number is negative.


floor

public abstract SNumber floor()
Returns the floor of this number.


ceiling

public abstract SNumber ceiling()
Returns the ceiling of this number.


truncate

public abstract SNumber truncate()
Returns this number truncated.


round

public abstract SNumber round()
Returns this number rounded.


exp

public abstract SNumber exp()
Returns e^(this number).


log

public abstract SNumber log()
Returns the natural logarithm of this number.


sin

public abstract SNumber sin()
Returns the sine of this number.


cos

public abstract SNumber cos()
Returns the cosine of this number.


tan

public abstract SNumber tan()
Returns the tangent of this number.


asin

public abstract SNumber asin()
Returns the arcsine of this number.


acos

public abstract SNumber acos()
Returns the arccosine of this number.


atan

public abstract SNumber atan(SNumber n)
Returns the arctangent of this number.


sqrt

public abstract SNumber sqrt()
Returns the square root of this number.


expt

public abstract SNumber expt(SNumber n)
Returns (this number)^n.


realPart

public abstract SNumber realPart()
Returns the real part of this number.


imagPart

public abstract SNumber imagPart()
Returns the imaginary part of this number.


angle

public abstract SNumber angle()
Returns the angle of this number.


toReal

public abstract SReal toReal()
Returns this number converted to a real number.


toInexact

public abstract SNumber toInexact()
Returns this number converted to an inexact value.