#include "fixed.h"
Go to the source code of this file.
Classes | |
class | fixed16 |
Defines | |
#define | F16SHIFT 16 |
#define | SHORT_FIXED(x) ( ((INT32)(x)) << F16SHIFT ) |
#define | F16ASSIGN(it) it |
#define | F16ASSIGNTHIS *this |
#define | FIXED16_DBL(d) fixed16::FromRawLong((INT32)((d)*65536)) |
Functions | |
fixed16 | operator+ (const fixed16 &operand1, const fixed16 &operand2) |
fixed16 | operator- (const fixed16 &operand1, const fixed16 &operand2) |
fixed16 | operator- (const fixed16 &operand) |
fixed16 | operator * (const fixed16 &operand1, const fixed16 &operand2) |
fixed16 | operator/ (const fixed16 &operand1, const fixed16 &operand2) |
fixed16 | operator>> (const fixed16 &operand1, UINT32 operand2) |
fixed16 | operator<< (const fixed16 &operand1, UINT32 operand2) |
INT32 | operator== (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator== (const fixed16 &operand1, const short operand2) |
INT32 | operator!= (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator!= (const fixed16 &operand1, const short operand2) |
INT32 | operator> (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator> (const fixed16 &operand1, const short operand2) |
INT32 | operator< (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator< (const fixed16 &operand1, const short operand2) |
INT32 | operator>= (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator>= (const fixed16 &operand1, const short operand2) |
INT32 | operator<= (const fixed16 &operand1, const fixed16 &operand2) |
INT32 | operator<= (const fixed16 &operand1, const short operand2) |
Variables | |
const INT32 | FIXED16_ONE = 0x10000L |
An FIXED16 is a signed 32-bit value with a binary point between bits 15 and 16. Its purpose is to represent 32-bit floating point numbers. FIXED16 is a fixed point number contained within a 32-bit longword. The high 16-bit half contains the integer part, the low half the fractional. (Intel implementations store this as the low half first in memory). The integer half ranges from -32768 to 32767, the fractional part from 0 to 65535/65536ths (1/65536th= 0.000015259, 65535/65536=0.999984741). For efficiency all primitives are written in assembly-language, though most are used transparently by operator overloading. No-one should include fixed16.h directly - always use ccmath.h. You should also never use the lower-case type 'fixed16' - always used 'FIXED16'. | |
const INT32 | FIXED16_HALF = 0x08000L |
CCAPI | xlong |
CCAPI | String |
|
|
|
|
|
|
|
Note that all the comment blocks live in the cpp files so they get compiled in with the help compiler |
|
|
|
Definition at line 376 of file fixed16.h. 00377 { 00378 fixed16 result; 00379 F16ASSIGN(result) = Fixed16Mul( operand1, operand2 ); 00380 return result; 00381 }
|
|
Definition at line 421 of file fixed16.h. 00422 { 00423 return operand1.all != SHORT_FIXED( operand2 ); 00424 }
|
|
Definition at line 416 of file fixed16.h.
|
|
Definition at line 355 of file fixed16.h. 00356 { 00357 fixed16 result; 00358 result.all = operand1.all + operand2.all; 00359 return result; 00360 }
|
|
Definition at line 369 of file fixed16.h.
|
|
Definition at line 362 of file fixed16.h. 00363 { 00364 fixed16 result; 00365 result.all = operand1.all - operand2.all; 00366 return result; 00367 }
|
|
Definition at line 383 of file fixed16.h. 00384 { 00385 fixed16 result; 00386 F16ASSIGN(result) = Fixed16Div( operand1, operand2 ); 00387 return result; 00388 }
|
|
Definition at line 441 of file fixed16.h. 00442 { 00443 return operand1.all < SHORT_FIXED( operand2 ); 00444 }
|
|
Definition at line 436 of file fixed16.h.
|
|
Definition at line 397 of file fixed16.h. 00398 { 00399 fixed16 result; 00400 00401 result.all = operand1.all << operand2; 00402 00403 return result; 00404 }
|
|
Definition at line 461 of file fixed16.h. 00462 { 00463 return operand1.all <= SHORT_FIXED( operand2 ); 00464 }
|
|
Definition at line 456 of file fixed16.h.
|
|
Definition at line 411 of file fixed16.h. 00412 { 00413 return operand1.all == SHORT_FIXED( operand2 ); 00414 }
|
|
Definition at line 406 of file fixed16.h.
|
|
Definition at line 431 of file fixed16.h. 00432 { 00433 return operand1.all > SHORT_FIXED(operand2); 00434 }
|
|
Definition at line 426 of file fixed16.h.
|
|
Definition at line 451 of file fixed16.h. 00452 { 00453 return operand1.all >= SHORT_FIXED( operand2 ); 00454 }
|
|
Definition at line 446 of file fixed16.h.
|
|
Definition at line 390 of file fixed16.h. 00391 { 00392 fixed16 result; 00393 result.all = operand1.all >> operand2; 00394 return result; 00395 }
|
|
|
|
An FIXED16 is a signed 32-bit value with a binary point between bits 15 and 16. Its purpose is to represent 32-bit floating point numbers. FIXED16 is a fixed point number contained within a 32-bit longword. The high 16-bit half contains the integer part, the low half the fractional. (Intel implementations store this as the low half first in memory). The integer half ranges from -32768 to 32767, the fractional part from 0 to 65535/65536ths (1/65536th= 0.000015259, 65535/65536=0.999984741). For efficiency all primitives are written in assembly-language, though most are used transparently by operator overloading. No-one should include fixed16.h directly - always use ccmath.h. You should also never use the lower-case type 'fixed16' - always used 'FIXED16'.
|
|
|
|
|