diff -r 73ea206103e6 -r 43365a9b78a3 kernel/eka/include/nkern/nklib.h --- a/kernel/eka/include/nkern/nklib.h Wed Jun 23 19:44:53 2010 +0300 +++ b/kernel/eka/include/nkern/nklib.h Tue Jul 06 15:50:07 2010 +0300 @@ -85,6 +85,39 @@ }; +/** +@internalComponent + +Ratio represented = iM*2^iX +e.g. 1.0 has iM=0x80000000, iX=-31 +*/ +struct SRatio + { + void Set(TUint32 aInt, TInt aDivisorExp=0); // set this ratio to aInt/2^aDivisorExp + TInt Reciprocal(); // this = 1/this + TInt Mult(TUint32& aInt32); // Multiply aInt32 by this ratio +// TInt Mult(TUint64& aInt64); // Multiply aInt64 by this ratio + + TUint32 iM; // mantissa, normalised so bit 31=1 + TInt16 iX; // -exponent. + TUint8 iSpare1; + TUint8 iSpare2; + }; + +/** +@internalComponent + +Ratio and inverse ratio +*/ +struct SRatioInv + { + void Set(const SRatio* aR); + + SRatio iR; + SRatio iI; + }; + + #if defined(__VC32__) || defined(__CW32__) extern "C" /** @internalComponent */