diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-AC99E9ED-2C02-561A-ABA4-DCDD415E8653.dita --- a/Symbian3/PDK/Source/GUID-AC99E9ED-2C02-561A-ABA4-DCDD415E8653.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-AC99E9ED-2C02-561A-ABA4-DCDD415E8653.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,49 +1,49 @@ - - - - - -Math -functionsDescribes the maths functions used by application programs. -
Calling syntax

Math functions are designed for -use by application programs which must be able firstly to do the desired calculation -and secondly to handle error conditions arising from the calculations. Thus, -the ANSI-style functions of the form

double sin(double); // typical declaration double x=1; // argument -double a; // result -a=sin(x); // typical use

are not implemented by the Symbian -software platform. Rather, all functions return error information explicitly.

All -functions are provided as static member functions of the Math class. -This is a convenient packaging mechanism. A typical math function is thus -declared like this:

class Math - { -public: - // ... - static TInt Sin(TReal &aTrg,const TReal &aSrc); - // ... - };

and used like this:

TReal x=1; // argument -TReal a; // result -TInt matherror; // error indication -matherror=Math::ASin(a,x); // get result and error -User::LeaveIfError(matherror); // handle error

This syntax -is unusual for those used to the ANSI library. However, the ANSI library functions -are designed for speed, and for users whose programs control the valid range -of the arguments, and can thus reasonably ensure that they are within range. -The Math class, however, provides direct support to expression -interpreters acting on numbers entered by users. In this context, error checking -is a vital part of the process.

In most cases, the same variable may -be used for both argument and result, i.e., Math::Sin(x,x) will -work as expected, because the function has finished with the argument by the -time the result is written to.

-
Precision

The TReal type is equated -to double. With an IEEE754 floating-point implementation, -this gives a range from about 2.225074 × 10 308 to -about 1.797693 × 10+308, and an accuracy of 15 decimal places.

-
Error indications

All functions return a standard -error code.

+ + + + + +Math +functionsDescribes the maths functions used by application programs. +
Calling syntax

Math functions are designed for +use by application programs which must be able firstly to do the desired calculation +and secondly to handle error conditions arising from the calculations. Thus, +the ANSI-style functions of the form

double sin(double); // typical declaration double x=1; // argument +double a; // result +a=sin(x); // typical use

are not implemented by the Symbian +software platform. Rather, all functions return error information explicitly.

All +functions are provided as static member functions of the Math class. +This is a convenient packaging mechanism. A typical math function is thus +declared like this:

class Math + { +public: + // ... + static TInt Sin(TReal &aTrg,const TReal &aSrc); + // ... + };

and used like this:

TReal x=1; // argument +TReal a; // result +TInt matherror; // error indication +matherror=Math::ASin(a,x); // get result and error +User::LeaveIfError(matherror); // handle error

This syntax +is unusual for those used to the ANSI library. However, the ANSI library functions +are designed for speed, and for users whose programs control the valid range +of the arguments, and can thus reasonably ensure that they are within range. +The Math class, however, provides direct support to expression +interpreters acting on numbers entered by users. In this context, error checking +is a vital part of the process.

In most cases, the same variable may +be used for both argument and result, i.e., Math::Sin(x,x) will +work as expected, because the function has finished with the argument by the +time the result is written to.

+
Precision

The TReal type is equated +to double. With an IEEE754 floating-point implementation, +this gives a range from about 2.225074 × 10 308 to +about 1.797693 × 10+308, and an accuracy of 15 decimal places.

+
Error indications

All functions return a standard +error code.

\ No newline at end of file