For example, I try to do something like this:
- (BOOL)compare:(NSDecimal)leftOperand greaterThan:(NSDecimal)rightOperand {
BOOL returnValue = NO;
NSComparisonResult result = NSDecimalCompare(&leftOperand, &rightOperand);
if (result == NSOrderedDescending) { // if the left operand is greater than the right operand
returnValue = YES;
}
return returnValue;
}
But I wonder how big is the cost for memory when using this wrapper. The NSDecimalCompare function takes parameters by reference (is that the word?). But my method does not. I find that by-reference stuff hard to use. Does my method create copies of these values? Is it a waste of memory?