Next: , Previous: , Up: Number   [Index]


1.122.9 Number: misc math

abs

Answer the absolute value of the receiver

arcCos

Answer the arc cosine of the receiver

arcCosh

Answer the hyperbolic arc-cosine of the receiver.

arcSin

Answer the arc sine of the receiver

arcSinh

Answer the hyperbolic arc-sine of the receiver.

arcTan

Answer the arc tangent of the receiver

arcTan: x

Answer the angle (measured counterclockwise) between (x, self) and a ray starting in (0, 0) and moving towards (1, 0) - i.e. 3 o’clock

arcTanh

Answer the hyperbolic arc-tangent of the receiver.

ceilingLog: radix

Answer (self log: radix) ceiling. Optimized to answer an integer.

cos

Answer the cosine of the receiver

cosh

Answer the hyperbolic cosine of the receiver.

estimatedLog

Answer an estimate of (self abs floorLog: 10). This method should be overridden by subclasses, but Number’s implementation does not raise errors - simply, it gives a correct result, so it is slow.

exp

Answer e raised to the receiver

floorLog: radix

Answer (self log: radix) floor. Optimized to answer an integer.

ln

Answer log base e of the receiver

log

Answer log base 10 of the receiver

log: aNumber

Answer log base aNumber of the receiver

negated

Answer the negated of the receiver

positiveDifference: aNumber

Answer the positive difference of the receiver and aNumber, that is self - aNumber if it is positive, 0 otherwise.

raisedTo: aNumber

Return self raised to aNumber power

raisedToInteger: anInteger

Return self raised to the anInteger-th power

sin

Answer the sine of the receiver

sinh

Answer the hyperbolic sine of the receiver.

sqrt

Answer the square root of the receiver

squared

Answer the square of the receiver

tan

Answer the tangent of the receiver

tanh

Answer the hyperbolic tangent of the receiver.

withSignOf: aNumber

Answer the receiver, with its sign possibly changed to match that of aNumber.


Next: , Previous: , Up: Number   [Index]