Mac OS 9
FixMath.h
Go to the documentation of this file.
1 
19 #ifndef __FIXMATH__
20 #define __FIXMATH__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #if PRAGMA_ONCE
27 #pragma once
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 #if PRAGMA_IMPORT
36 #pragma import on
37 #endif
38 
39 #if PRAGMA_STRUCT_ALIGN
40 #pragma options align = mac68k
41 #elif PRAGMA_STRUCT_PACKPUSH
42 #pragma pack(push, 2)
43 #elif PRAGMA_STRUCT_PACK
44 #pragma pack(2)
45 #endif
46 
47 #define fixed1 ((Fixed)0x00010000L)
48 #define fract1 ((Fract)0x40000000L)
49 #define positiveInfinity ((long)0x7FFFFFFFL)
50 #define negativeInfinity ((long)0x80000000L)
77  Fixed
78  FixRatio(short numer, short denom);
79 
100  Fixed
102 
130  short
132 
147  Fract
149 
164  long
166 
182  Fixed
183  Long2Fix(long x);
184 
199  Fixed
200  Frac2Fix(Fract x);
201 
225  Fract
226  FracMul(Fract x, Fract y);
227 
255  Fixed
257 
285  Fract
286  FracDiv(Fract x, Fract y);
287 
301  Fract
302  FracSqrt(Fract x);
303 
317  Fract
319 
333  Fract
335 
352  Fixed
353  FixATan2(long x, long y);
354 
364 #if TARGET_CPU_68K
365 #if TARGET_RT_MAC_68881
366 #if CALL_NOT_IN_CARBON
367 
382  long double
383  Frac2X(Fract x);
384 
398  long double
399  Fix2X(Fixed x);
400 
415  Fixed
416  X2Fix(long double x);
417 
432  Fract
433  X2Frac(long double x);
434 
435 #endif
437 #else
438 #if CALL_NOT_IN_CARBON
439 
454  long double
455  Frac2X(Fract x);
456 
470  long double
471  Fix2X(Fixed x);
472 
487  Fixed
488  X2Fix(long double x);
489 
504  Fract
505  X2Frac(long double x);
506 
507 #endif
509 #endif
511 #else
512 
527 double
528 Frac2X(Fract x);
529 
543 double
545 
560 Fixed
561 X2Fix(double x);
562 
577 Fract
578 X2Frac(double x);
579 
580 #endif
583 #if TARGET_CPU_PPC || !TARGET_OS_MAC
592  short
593  WideCompare(const wide *target, const wide *source);
594 
603  wide *
604  WideAdd(wide *target, const wide *source);
605 
614  wide *
615  WideSubtract(wide *target, const wide *source);
616 
625  wide *
626  WideNegate(wide *target);
627 
636  wide *
637  WideShift(wide *target, long shift);
638 
647  unsigned long
648  WideSquareRoot(const wide *source);
649 
658  wide *
659  WideMultiply(long multiplicand, long multiplier, wide *target);
660 
670  long
671  WideDivide(const wide *dividend, long divisor, long *remainder);
672 
682  wide *
683  WideWideDivide(wide *dividend, long divisor, long *remainder);
684 
693  wide *
694  WideBitShift(wide *src, long shift);
695 
696 #endif
698 #if PRAGMA_STRUCT_ALIGN
699 #pragma options align = reset
700 #elif PRAGMA_STRUCT_PACKPUSH
701 #pragma pack(pop)
702 #elif PRAGMA_STRUCT_PACK
703 #pragma pack()
704 #endif
705 
706 #ifdef PRAGMA_IMPORT_OFF
707 #pragma import off
708 #elif PRAGMA_IMPORT
709 #pragma import reset
710 #endif
711 
712 #ifdef __cplusplus
713 }
714 #endif
715 
716 #endif
717 * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/
Fixed FixDiv(Fixed x, Fixed y)
Fract FracSin(Fixed x)
Fract FracCos(Fixed x)
Fract FracMul(Fract x, Fract y)
unsigned long WideSquareRoot(const wide *source)
Fixed FixMul(Fixed a, Fixed b)
wide * WideBitShift(wide *src, long shift)
long Fix2Long(Fixed x)
Fract FracDiv(Fract x, Fract y)
long WideDivide(const wide *dividend, long divisor, long *remainder)
double Fix2X(Fixed x)
Convert a Fixed to an Extended data type.
Fixed Long2Fix(long x)
Fract FracSqrt(Fract x)
wide * WideWideDivide(wide *dividend, long divisor, long *remainder)
wide * WideAdd(wide *target, const wide *source)
Fixed FixRatio(short numer, short denom)
Fixed Frac2Fix(Fract x)
double Frac2X(Fract x)
Convert a Fract to an Extended data type.
Fixed X2Fix(double x)
Convert an Extended to a Fixed data type.
short FixRound(Fixed x)
wide * WideSubtract(wide *target, const wide *source)
wide * WideMultiply(long multiplicand, long multiplier, wide *target)
Fract Fix2Frac(Fixed x)
wide * WideShift(wide *target, long shift)
short WideCompare(const wide *target, const wide *source)
wide * WideNegate(wide *target)
Fixed FixATan2(long x, long y)
Fract X2Frac(double x)
Convert an Extended to a Fract data type.
Basic Macintosh data types.
long Fixed
Definition: MacTypes.h:153
x
Definition: ToolUtils.h:163
Definition: MacTypes.h:104