Deprecated Mathematical and Logical Utilities Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.8

annuity

(Deprecated in OS X v10.8.)

double annuity (
   double rate,
   double periods
);
Parameters
rate
periods
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

BitAnd

Performs the AND logical operation on two long words. (Deprecated in OS X v10.8.)

long BitAnd (
   long value1,
   long value2
);
Parameters
value1

A long word.

value2

A long word.

Return Value

A long word that is the result of the AND operation on the long words passed as arguments. Each bit in the returned value is set if and only if the corresponding bit is set in both value1 and value2.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

BitClr

Clears a particular bit (to a value of 0). (Deprecated in OS X v10.8.)

void BitClr (
   void *bytePtr,
   long bitNum
);
Parameters
bytePtr

A pointer to a byte in memory.

bitNum

The bit to be cleared, specified as a positive offset from the high-order bit of the byte pointed to by the bytePtr parameter. The bit being cleared need not be in the same byte pointed to by bytePtr.

Special Considerations

The bit numbering scheme used by the BitClr function is the opposite of the MC680x0 numbering. To convert an MC680x0 bit number to the format required by the BitClr function, subtract the MC680x0 bit number from the highest bit number.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

BitNot

Performs the NOT logical operation on a long word. (Deprecated in OS X v10.8.)

long BitNot (
   long value
);
Parameters
value

A long word.

Return Value

A long word that is the result of the NOT operation on the long word passed in as an argument. Each bit in the returned value is set if and only if the corresponding bit is not set in value.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

BitOr

Performs the OR logical operation on two long words. (Deprecated in OS X v10.8.)

long BitOr (
   long value1,
   long value2
);
Parameters
value1

A long word.

value2

A long word.

Return Value

A long word that is the result of the OR operation on the long words passed as arguments. Each bit in the returned value is set if and only if the corresponding bit is set in value1 or value2, or in both value1 and value2.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

BitSet

Sets a particular bit (to a value of 1). (Deprecated in OS X v10.8.)

void BitSet (
   void *bytePtr,
   long bitNum
);
Parameters
bytePtr

A pointer to a byte in memory.

bitNum

The bit to be set, specified as a positive offset from the high-order bit of the byte pointed to by the bytePtr parameter. The bit being set need not be in the byte pointed to by bytePtr.

Special Considerations

The bit numbering scheme used by the BitSet function is the opposite of the MC680x0 numbering. To convert an MC680x0 bit number to the format required by the BitSet function, subtract the MC680x0 bit number from the highest bit number.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
ToolUtils.h

BitShift

Shifts bits in a long word. (Deprecated in OS X v10.8.)

long BitShift (
   long value,
   short count
);
Parameters
value

A long word.

count

The number of bits to shift. If this number is positive, BitShift shifts this many positions to the left; if this number is negative, BitShift shifts this many positions to the right. The value in this parameter is converted to the result of MOD 32.

Return Value

A long word that is the result of shifting the bits in the long word passed in as an argument. The shift’s direction and extent are determined by the count parameter. Zeroes are shifted into empty positions regardless of the direction of the shift.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
ToolUtils.h

BitTst

Determines whether a given bit is set. (Deprecated in OS X v10.8.)

Boolean BitTst (
   const void *bytePtr,
   long bitNum
);
Parameters
bytePtr

A pointer to a byte in memory.

bitNum

The bit to be tested, specified as a positive offset from the high-order bit of the byte pointed to by the bytePtr parameter. The bit being tested need not be in the byte pointed to by bytePtr.

Return Value

TRUE if the specified bit is set (that is, has a value of 1) and FALSE if the bit is cleared (that is, has a value of 0).

Special Considerations

The bit numbering scheme used by the BitTst function is the opposite of the MC680x0 numbering. To convert an MC680x0 bit number to the format required by the BitTst function, subtract the MC680x0 bit number from the highest bit number.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

BitXor

Performs the XOR logical operation on two long words. (Deprecated in OS X v10.8.)

long BitXor (
   long value1,
   long value2
);
Parameters
value1

A long word.

value2

A long word.

Return Value

A long word that is the result of the XOR operation on the long words passed in as arguments. Each bit in the returned value is set if and only if the corresponding bit is set in either value1 or value2, but not in both value1 and value2.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
ToolUtils.h

compound

(Deprecated in OS X v10.8.)

double compound (
   double rate,
   double periods
);
Parameters
rate
periods
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dec2f

(Deprecated in OS X v10.8.)

float dec2f (
   const decimal *d
);
Parameters
d
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dec2l

(Deprecated in OS X v10.8.)

long dec2l (
   const decimal *d
);
Parameters
d
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dec2num

(Deprecated in OS X v10.8.)

double_t dec2num (
   const decimal *d
);
Parameters
d
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dec2s

(Deprecated in OS X v10.8.)

short dec2s (
   const decimal *d
);
Parameters
d
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dec2str

(Deprecated in OS X v10.8.)

void dec2str (
   const decform *f,
   const decimal *d,
   char *s
);
Parameters
f
d
s
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

dtox80

(Deprecated in OS X v10.8.)

void dtox80 (
   const double *x,
   extended80 *x80
);
Parameters
x
x80
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

Fix2Frac

Converts a Fixed number to a Fract number. (Deprecated in OS X v10.8.)

Fract Fix2Frac (
   Fixed x
);
Parameters
x

The Fixed number to be converted to a Fract number.

Return Value

The Fract number equivalent to the Fixed number x. If x is greater than the maximum representable Fract number, the Fix2Frac function returns $7FFFFFFF. If x is less than the negative number with the highest absolute value, Fix2Frac returns $80000000.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

Fix2Long

Converts a Fixed number to a LongInt number. (Deprecated in OS X v10.8.)

SInt32 Fix2Long (
   Fixed x
);
Parameters
x

The Fixed number to be converted to a long integer.

Return Value

The long integer nearest to the Fixed number x. If x is halfway between two integers (0.5), it is rounded to the integer with the higher absolute value.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

Fix2X

Converts a Fixed number to an Extended number. (Deprecated in OS X v10.8.)

double Fix2X (
   Fixed x
);
Parameters
x

The Fixed number to be converted to an Extended number.

Return Value

The Extended equivalent of the Fixed number x.

Special Considerations

Fix2X does not move memory; you can call it at interrupt time.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FixATan2

Obtains a fast approximation of the arctangent of a fraction. (Deprecated in OS X v10.8.)

Fixed FixATan2 (
   SInt32 x,
   SInt32 y
);
Parameters
x

The numerator of the fraction whose arctangent is to be obtained. This variable can be a LongInt, Fixed, or Fract number.

y

The denominator of the fraction whose arctangent is to be obtained. The number supplied in this variable must be of the same type as that of the number supplied in the x parameter.

Return Value

The arctangent of y/x, in radians.

Discussion

The approximation of p/4 used to compute the arctangent is the hexadecimal value 0.C910, making the approximation of p equal to 3.1416015625, while p itself equals 3.14159265.... Thus FixATan2(1, 1) equals the equivalent of the hexadecimal value 0.C910. Despite the approximation of p, the arctangent value obtained will usually be correct to several decimal places.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FixDiv

Divides two variables of the same type (Fixed, Fract, or LongInt) or to divide a LongInt or Fract number by a Fixed number. (Deprecated in OS X v10.8.)

Fixed FixDiv (
   Fixed x,
   Fixed y
);
Parameters
x

The first operand, which can be a variable of type Fixed or a variable of type Fract or LongInt.

y

The second operand, which can be a variable of type Fixed or it can be a variable of the same type as the variable in parameter x.

Return Value

The quotient of the numbers in x and y. If the y parameter is in the format of a Fixed number, then the x parameter can be in the format of a Fixed, Fract, or LongInt number. If the y parameter is in the format of a Fract or LongInt number, then the x parameter must be in the same format.

The returned value is in the format of a Fixed number if both x and y are both Fixed numbers, both Fract numbers, or both LongInt numbers. Otherwise, the returned value is the same type as the number in the x parameter.

Division by zero results in $8000000 if x is negative, and $7FFFFFFF otherwise; thus the special case 0/0 yields $7FFFFFFF.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FixMul

Multiplies a variable of type Fixed with another variable of type Fixed or with a variable of type Fract or LongInt. (Deprecated in OS X v10.8.)

Fixed FixMul (
   Fixed a,
   Fixed b
);
Parameters
a

The first operand, which can be a variable of type Fixed or a variable of type Fract or LongInt.

b

The second operand, which can be a variable of type Fixed or a variable of type Fract or LongInt.

Return Value

The product of the numbers in a and b. At least one of a and b should be a variable of type Fixed.

The returned value is in the format of a LongInt if one of a or b is a LongInt. It is a Fract number if one of a or b is Fract. It is a Fixed number if both a and b are Fixed numbers.

Overflows are set to the maximum representable value with the correct sign ($80000000 for negative results and $7FFFFFFF for positive results).

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FixRatio

Obtains the Fixed equivalent of a fraction. (Deprecated in OS X v10.8.)

Fixed FixRatio (
   short numer,
   short denom
);
Parameters
numer

The numerator of the fraction.

denom

The denominator of the fraction.

Return Value

The Fixed equivalent of the fraction numer/denom.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FixRound

Rounds a fixed-point number to the nearest integer. (Deprecated in OS X v10.8.)

short FixRound (
   Fixed x
);
Parameters
x

The Fixed number to be rounded.

Return Value

The Integer number nearest the Fixed number x. If the value is halfway between two integers (0.5), it is rounded up. Thus, 4.5 is rounded to 5, and –3.5 is rounded to –3.

Discussion

To round a negative Fixed number so that values halfway between two integers are rounded to the number with the higher absolute value, negate the number, round it, and then negate it again.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

Frac2Fix

Converts a Fract number to a Fixed number. (Deprecated in OS X v10.8.)

Fixed Frac2Fix (
   Fract x
);
Parameters
x

The Fract number to be converted to a Fixed number.

Return Value

The Fixed number that best approximates the Fract number x.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

Frac2X

Converts a Fract number to an Extended number. (Deprecated in OS X v10.8.)

double Frac2X (
   Fract x
);
Parameters
x

The Fract number to be converted to an Extended number.

Return Value

The Extended equivalent of the Fract number x.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FracCos

Obtains a fast approximation of the cosine of a Fixed number. (Deprecated in OS X v10.8.)

Fract FracCos (
   Fixed x
);
Parameters
x

The Fixed number expressed in radians, whose cosine is to be calculated.

Return Value

The cosine, expressed in radians, of the Fixed number x.

Discussion

The approximation of p/4 used to compute the cosine is the hexadecimal value 0.C910, making the approximation of p equal to 3.1416015625, while p itself equals 3.14159265.... Despite the approximation of p, the cosine value obtained is usually correct to several decimal places.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FracDiv

Divides two variables of the same type (Fract, Fixed, or LongInt) or to divide a LongInt or Fixed number by a Fract number. (Deprecated in OS X v10.8.)

Fract FracDiv (
   Fract x,
   Fract y
);
Parameters
x

The first operand, which can be a variable of type Fract or a variable of type Fixed or LongInt.

y

The second operand, which can be a variable of type Fract or a variable of the same type as the variable in parameter a.

Return Value

The quotient of the numbers in a and b. If the b parameter is in the format of a Fract number, then the a parameter can be in the format of a Fract, a Fixed, or a LongInt number. If the b parameter is in the format of a Fixed or a LongInt number, then the a parameter must be in the same format.

The returned value is in the format of a Fract number if a and b are both Fract numbers, both Fixed numbers, or both LongInt numbers. Otherwise, the returned value is in the same format as the number in the a parameter.

Division by zero results in $8000000 if a is negative, and $7FFFFFFF otherwise; thus the special case 0/0 yields $7FFFFFFF.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FracMul

Multiplies a variable of type Fract with another variable of type Fract or with a variable of type Fixed or LongInt. (Deprecated in OS X v10.8.)

Fract FracMul (
   Fract x,
   Fract y
);
Parameters
x

The first operand, which can be a variable of type Fract or a variable of type Fixed or LongInt.

y

The second operand, which can be a variable of type Fract or a variable of type Fixed or LongInt.

Return Value

The product of the numbers in a and b. At least one of a or b should be a variable of type Fract.

The returned value is in the format of a LongInt number if one of a and b is a LongInt number. It is a Fixed number if one of a or b is a Fixed number. It is a Fract number if both a and b are Fract numbers.

Overflows are set to the maximum representable value with the correct sign ($80000000 for negative results and $7FFFFFFF for positive results).

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FracSin

Obtains a fast approximation of the sine of a Fixed number. (Deprecated in OS X v10.8.)

Fract FracSin (
   Fixed x
);
Parameters
x

The Fixed number expressed in radians, whose sine is to be calculated.

Return Value

The sine, expressed in radians, of the Fixed number x.

Discussion

The approximation of p/4 used to compute the sine is the hexadecimal value 0.C910, making the approximation of p equal to 3.1416015625, while p itself equals 3.14159265.... Despite the approximation of p, the sine value obtained is usually correct to several decimal places.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

FracSqrt

Obtains the square root of a Fract number. (Deprecated in OS X v10.8.)

Fract FracSqrt (
   Fract x
);
Parameters
x

The Fract number to obtain a square root of. This parameter is interpreted as being unsigned in the range 0 through 4 – 2–30, inclusive. That is, the bit of the Fract number that ordinarily has weight -2 is instead interpreted as having weight 2.

Return Value

The square root of the specified Fract number. The result is unsigned in the range 0 through 2, inclusive.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

Long2Fix

Converts a LongInt number to a Fixed number. (Deprecated in OS X v10.8.)

Fixed Long2Fix (
   SInt32 x
);
Parameters
x

The long integer to be converted to a Fixed number.

Return Value

The Fixed number equivalent to the long integer x. If x is greater than the maximum representable fixed-point number, the Long2Fix function returns $7FFFFFFF. If x is less than the negative number with the highest absolute value, Long2Fix returns $80000000.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

num2dec

(Deprecated in OS X v10.8.)

void num2dec (
   const decform *f,
   double_t x,
   decimal *d
);
Parameters
f
x
d
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

randomx

(Deprecated in OS X v10.8.)

double_t randomx (
   double_t *x
);
Parameters
x
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

relation

(Deprecated in OS X v10.8.)

relop relation (
   double_t x,
   double_t y
);
Parameters
x
y
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

S64Compare

(Deprecated in OS X v10.8.)

SInt32 S64Compare (
   SInt64 left,
   SInt64 right
);
Parameters
left
right
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Math64.h

str2dec

(Deprecated in OS X v10.8.)

void str2dec (
   const char *s,
   short *ix,
   decimal *d,
   short *vp
);
Parameters
s
ix
d
vp
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h

U64Compare

(Deprecated in OS X v10.8.)

SInt32 U64Compare (
   UInt64 left,
   UInt64 right
);
Parameters
left
right
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Math64.h

WideAdd

(Deprecated in OS X v10.8.)

wide * WideAdd (
   wide *target,
   const wide *source
);
Parameters
target
source
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideBitShift

(Deprecated in OS X v10.8.)

wide * WideBitShift (
   wide *target,
   SInt32 shift
);
Parameters
src
shift
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideCompare

(Deprecated in OS X v10.8.)

short WideCompare (
   const wide *target,
   const wide *source
);
Parameters
target
source
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideDivide

(Deprecated in OS X v10.8.)

SInt32 WideDivide (
   const wide *dividend,
   SInt32 divisor,
   SInt32 *remainder
);
Parameters
dividend
divisor
remainder
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideMultiply

(Deprecated in OS X v10.8.)

wide * WideMultiply (
   SInt32 multiplicand,
   SInt32 multiplier,
   wide *target
);
Parameters
multiplicand
multiplier
target
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideNegate

(Deprecated in OS X v10.8.)

wide * WideNegate (
   wide *target
);
Parameters
target
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideShift

(Deprecated in OS X v10.8.)

wide * WideShift (
   wide *target,
   SInt32 shift
);
Parameters
target
shift
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideSquareRoot

(Deprecated in OS X v10.8.)

UInt32 WideSquareRoot (
   const wide *source
);
Parameters
source
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideSubtract

(Deprecated in OS X v10.8.)

wide * WideSubtract (
   wide *target,
   const wide *source
);
Parameters
target
source
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

WideWideDivide

(Deprecated in OS X v10.8.)

wide * WideWideDivide (
   wide *dividend,
   SInt32 divisor,
   SInt32 *remainder
);
Parameters
dividend
divisor
remainder
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

X2Fix

Converts an Extended number to a Fixed number. (Deprecated in OS X v10.8.)

Fixed X2Fix (
   double x
);
Parameters
x

The Extended number to be converted to a Fixed number.

Return Value

The best Fixed approximation of the Extended number x. If x is greater than the maximum representable Fixed number, the X2Fix function returns $7FFFFFFF. If x is less than the negative number with the highest absolute value, X2Fix returns $80000000.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

X2Frac

Converts an Extended number to a Fract number. (Deprecated in OS X v10.8.)

Fract X2Frac (
   double x
);
Parameters
x

The Extended number to be converted to a Fract number.

Return Value

The best Fract approximation of the Extended number x. If x is greater than the maximum representable Fract number, the X2Frac function returns $7FFFFFFF. If x is less than the negative number with the highest absolute value, X2Frac returns $80000000.

Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
FixMath.h

x80tod

(Deprecated in OS X v10.8.)

double x80tod (
   const extended80 *x80
);
Parameters
x80
Return Value
Availability
  • Available in Mac OS X version 10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
fp.h