DekGenius.com
[ Team LiB ] Previous Section Next Section

10.4 Decimals

These functions are used to perform decimal arithmetic with NSDecimal type structs. The Foundation class NSDecimalNumber may also be used for decimal arithmetic.

NSDecimalAdd

NSCalculationError NSDecimalAdd(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode)

NSDecimalCompact

void NSDecimalCompact(NSDecimal *number)

NSDecimalCompare

NSComparisonResult NSDecimalCompare(const NSDecimal *leftOperand, const NSDecimal *rightOperand)

NSDecimalCopy

void NSDecimalCopy(NSDecimal *destination, const NSDecimal *source)

NSDecimalDivide

NSCalculationError NSDecimalDivide(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode)

NSDecimalMultiply

NSCalculationError NSDecimalMultiply(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode)

NSDecimalMultiplyByPowerOf10

NSCalculationError NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *number, short power, NSRoundingMode roundingMode)

NSDecimalNormalize

NSCalculationError NSDecimalNormalize(NSDecimal *number1, NSDecimal *number2, NSRoundingMode roundingMode)

NSDecimalPower

NSCalculationError NSDecimalPower(NSDecimal *result, const NSDecimal *number, unsigned power, NSRoundingMode roundingMode)

NSDecimalRound

void NSDecimalRound(NSDecimal *result, const NSDecimal *number, int scale, NSRoundingMode roundingMode)

NSDecimalString

NSString *NSDecimalString(const NSDecimal *dcm, NSDictionary *locale)

NSDecimalSubtract

NSCalculationError NSDecimalSubtract(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode)

    [ Team LiB ] Previous Section Next Section