Math functions from C run-time library

C run-time library (msvcrt.dll) contains many useful functions. You can find reference in MSDN library.

 

Several examples:

 

To calculate floating-point remainder, use function fmod.

Example: double rem=fmod(x y) .

 

To calculate x raised to the power of y, use function pow.

Example: double pw=pow(x y) .

 

To calculate x square root, use function sqrt.

Example: double sq=sqrt(x) .

 

Before using dll functions, they must be declared. For example, if function in MSDN library is given as:

 

double fmod(

double x,

double y

);

 

then QM declaration would be:

dll msvcrt ^fmod ^x ^y

 

QM declares several math functions from C run-time library. They are added to math category.

 

Example

double angleDegrees=30

def PI 3.1415926535897932384626433832795

double s=sin(angleDegrees*PI/180) ;;converts degrees to radians and calculates sin
double a=asin(s)*180/PI ;;calculates arcsin and converts radians to degrees
out s
out a