79 fixed(
int numerator,
int denominator);
82 fixed(
int value) {Data.Composite.Fraction = 0;Data.Composite.Whole = (
unsigned char)
value;}
85 fixed(
char const * ascii);
88 operator unsigned (
void)
const {
return(((
unsigned)Data.Raw+(256/2)) / 256);}
95 fixed &
operator /= (
fixed const & rvalue) {
if (rvalue.Data.
Raw != 0 && rvalue.Data.
Raw != 256) Data.
Raw = (
unsigned short)(((
int)Data.Raw * 256) / rvalue);
return(*
this);}
96 fixed &
operator /= (
int rvalue) {
if (rvalue) Data.
Raw = (
unsigned short)((
unsigned)Data.Raw / rvalue);
return(*
this);}
106 const int operator * (
int rvalue)
const {
return ((((
unsigned)Data.Raw * rvalue) + (256/2)) / 256);}
108 const fixed operator / (
fixed const & rvalue)
const {
fixed temp = *
this;
if (rvalue.Data.
Raw != 0 && rvalue.Data.
Raw != 256) temp.Data.
Raw = (
unsigned short)(((
int)temp.Data.
Raw * 256) / rvalue.Data.
Raw);
return(temp);}
109 const int operator / (
int rvalue)
const {
if (rvalue)
return(((
unsigned)Data.Raw+(256/2)) / ((
unsigned)rvalue*256));
return(*
this);}
112 const int operator + (
int rvalue)
const {
return((((
unsigned)Data.Raw+(256/2))/256) + rvalue);}
115 const int operator - (
int rvalue)
const {
return((((
unsigned)Data.Raw+(256/2))/256) - rvalue);}
139 bool operator < (
int rvalue)
const {
return(Data.Raw < (rvalue*256));}
140 bool operator > (
int rvalue)
const {
return(Data.Raw > (rvalue*256));}
141 bool operator <= (
int rvalue)
const {
return(Data.Raw <= (rvalue*256));}
142 bool operator >= (
int rvalue)
const {
return(Data.Raw >= (rvalue*256));}
143 bool operator == (
int rvalue)
const {
return(Data.Raw == (rvalue*256));}
144 bool operator != (
int rvalue)
const {
return(Data.Raw != (rvalue*256));}
149 friend const int operator * (
int lvalue,
fixed const & rvalue) {
return(rvalue * lvalue);}
150 friend const int operator / (
int lvalue,
fixed const & rvalue) {
if (rvalue.Data.
Raw == 0 || rvalue.Data.
Raw == 256)
return (lvalue);
return(((
unsigned)(lvalue * 256)+(256/2)) / rvalue.Data.
Raw);}
151 friend const int operator + (
int lvalue,
fixed const & rvalue) {
return(rvalue + lvalue);}
152 friend const int operator - (
int lvalue,
fixed const & rvalue) {
return((((lvalue*256) - rvalue.Data.
Raw) + (256/2)) / 256);}
153 friend bool operator < (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) < rvalue.Data.
Raw);}
154 friend bool operator > (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) > rvalue.Data.
Raw);}
155 friend bool operator <= (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) <= rvalue.Data.
Raw);}
156 friend bool operator >= (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) >= rvalue.Data.
Raw);}
157 friend bool operator == (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) == rvalue.Data.
Raw);}
158 friend bool operator != (
unsigned lvalue,
fixed const & rvalue) {
return((lvalue*256) != rvalue.Data.
Raw);}
159 friend int operator *= (
int & lvalue,
fixed const & rvalue) {lvalue = lvalue * rvalue;
return(lvalue);}
160 friend int operator /= (
int & lvalue,
fixed const & rvalue) {lvalue = lvalue / rvalue;
return(lvalue);}
161 friend int operator += (
int & lvalue,
fixed const & rvalue) {lvalue = lvalue + rvalue;
return(lvalue);}
162 friend int operator -= (
int & lvalue,
fixed const & rvalue) {lvalue = lvalue - rvalue;
return(lvalue);}
167 void Round_Up(
void) {Data.Raw += (
unsigned short)(256-1);Data.Composite.Fraction = 0;}
170 void Saturate(
unsigned capvalue) {
if (Data.Raw > (capvalue*256)) Data.Raw = (
unsigned short)(capvalue*256);}
171 void Saturate(
fixed const & capvalue) {
if (*
this > capvalue) *
this = capvalue;}
172 void Sub_Saturate(
unsigned capvalue) {
if (Data.Raw >= (capvalue*256)) Data.Raw = (
unsigned short)((capvalue*256)-1);}
173 void Sub_Saturate(
fixed const & capvalue) {
if (*
this >= capvalue) Data.Raw = (
unsigned short)(capvalue.Data.
Raw-1);}
192 int To_ASCII(
char * buffer,
int maxlen=-1)
const;
const fixed operator<<(unsigned rvalue) const
bool operator<=(fixed const &rvalue) const
bool operator>=(fixed const &rvalue) const
int To_ASCII(char *buffer, int maxlen=-1) const
bool operator!=(fixed const &rvalue) const
void Saturate(fixed const &capvalue)
const fixed operator>>(unsigned rvalue) const
const fixed operator-(fixed const &rvalue) const
friend const fixed Round(fixed const &value)
bool operator==(fixed const &rvalue) const
bool operator<(fixed const &rvalue) const
friend const fixed Inverse(fixed const &value)
friend const fixed Sub_Saturate(fixed const &value, fixed const &capvalue)
fixed & operator<<=(unsigned rvalue)
fixed & operator-=(fixed const &rvalue)
fixed & operator>>=(unsigned rvalue)
bool operator!(void) const
fixed & operator*=(fixed const &rvalue)
friend const fixed Saturate(fixed const &value, fixed const &capvalue)
const fixed operator+(fixed const &rvalue) const
fixed & operator/=(fixed const &rvalue)
void Saturate(unsigned capvalue)
void Sub_Saturate(unsigned capvalue)
const fixed operator*(fixed const &rvalue) const
friend const fixed Round_Down(fixed const &value)
bool operator>(fixed const &rvalue) const
void Sub_Saturate(fixed const &capvalue)
struct fixed::@141331102007176150364077173260123361077306114004::@374377020112267201331161232154127230072223061360 Composite
fixed & operator+=(fixed const &rvalue)
char const * As_ASCII(void) const
friend const fixed Saturate(fixed const &value, unsigned capvalue)
friend const fixed Sub_Saturate(fixed const &value, unsigned capvalue)
friend const fixed Round_Up(fixed const &value)
const fixed operator/(fixed const &rvalue) const