NSNumber(OLArithmetic) Category Reference

A category for implementing the OLArithmetic protocol using the NSNumber class from the Cocoa Foundation library. More...

#import <ObjectiveLib/Arithmetic.h>

List of all members.

Public Member Functions

(id) - arithmeticAdd:
 Add the value of a given object to this object's value.
(id) - arithmeticDivideBy:
 Divide this object's value by the value of another object.
(id) - arithmeticModulus:
 Compute the remainder of division by the value of a given object.
(id) - arithmeticMultiply:
 Multiply this object's value by the value of a given one.
(id) - arithmeticNegate
 Negate the value of this object.
(id) - arithmeticSubtract:
 Subtract the value of a given object from this object's value.


Detailed Description

A category for implementing the OLArithmetic protocol using the NSNumber class from the Cocoa Foundation library.

All objects used by these methods should be forms of NSNumber, or the operations will not work as expected.


Member Function Documentation

- (id) arithmeticAdd: (id)  value  

Add the value of a given object to this object's value.

The two values are added together and a new object containing the result is returned. The result is the same as using operator + in Standard C.

Parameters:
value the value to add
Returns:
the result of the addition

- (id) arithmeticDivideBy: (id)  value  

Divide this object's value by the value of another object.

The result of the division is returned in a newly created object. The result is the same as using operator / in Standard C.

Parameters:
value the value by which to divide
Returns:
the result of the division

- (id) arithmeticModulus: (id)  value  

Compute the remainder of division by the value of a given object.

The result is returned in a newly created object. The result is the same as using operator % in Standard C.

Parameters:
value the value by which to divide
Returns:
the remainder of the division

- (id) arithmeticMultiply: (id)  value  

Multiply this object's value by the value of a given one.

The result of the multiplication is returned in a newly created object. The result is the same as using operator * in Standard C.

Parameters:
value the value by which to multiply
Returns:
the result of the multiplication

- (id) arithmeticNegate  

Negate the value of this object.

The negated value is returned in a newly created object. The result is the same as using the unary operator - in Standard C.

Returns:
the result of the negation

- (id) arithmeticSubtract: (id)  value  

Subtract the value of a given object from this object's value.

The given value is subtracted and a new object containing the result is returned. The result is the same as using binary operator - in Standard C.

Parameters:
value the value to subtract
Returns:
the result of the subtraction


The documentation for this category was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:12:48 2007, © 2004-2007 Will Mason
SourceForge.net Logo