G:/ScriptBasic/source/commands/mathfunc.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#include "../command.h"

Go to the source code of this file.

Defines

#define GET_ONE_ARG   USE_CALLER_MORTALS; nItem = PARAMETERLIST; Op1 = EVALUATEEXPRESSION(CAR(nItem)); NONULOP(Op1)

Functions

long * RaiseError (pExecuteObject pEo)
GET_ONE_ARG RETURN_DOUBLE_VALUE_OR_LONG (pow(10.0, GETDOUBLEVALUE(Op1)))
 RETURN_DOUBLE_VALUE_OR_LONG (log(dop1))
 RETURN_DOUBLE_VALUE_OR_LONG (log10(dop1))
 RETURN_DOUBLE_VALUE_OR_LONG (asin(dop1))
 RETURN_DOUBLE_VALUE_OR_LONG (acos(dop1))
GET_ONE_ARG if (ISINTEGER(Op1))
 if (dop1< 0)
 RETURN_DOUBLE_VALUE (sqrt(dop1))
 RETURN_DOUBLE_VALUE (dop1 > 0.0?dop1:-dop1)
GET_ONE_ARG if (TYPE(Op1)==VTYPE_STRING)
 RETURN_DOUBLE_VALUE (dop1)
 if (dop1==(double) lop1)
 if (nItem)
 if (iNumberOfDigits==0)
 while (iNumberOfDigits--)
 if (GETLONGVALUE(Op1)&1) LONGVALUE(RESULT)
else LONGVALUE (RESULT)=0
 switch (TYPE(ItemResult))
 if (memory_IsUndef(ItemResult))
 if (memory_IsUndef(ItemResult)||(TYPE(ItemResult)==VTYPE_STRING &&STRLEN(ItemResult)==0))

Variables

NODE nItem
VARIABLE Op1
double dResult
VARIABLE Op1
double dop1
long lop1
long result
END NODE nItem
VARIABLE Op1
double dResult
long lSquare
long lop1
double dop1
 dop1 = GETDOUBLEVALUE(Op1)
 dop1 = GETDOUBLEVALUE(Op1)
END NODE nItem
VARIABLE Op1
END USE_CALLER_MORTALS
END USE_CALLER_MORTALS
END USE_CALLER_MORTALS
 RESULT = NULL
END USE_CALLER_MORTALS
END USE_CALLER_MORTALS
END NODE nItem
VARIABLE Op1
double dop1
long lop1
int isneg
 dop1 = GETDOUBLEVALUE(Op1)
END NODE nItem
VARIABLE Op1
double dop1
long lop1
 dop1 = floor(GETDOUBLEVALUE(Op1))
 lop1 = (long)dop1
END NODE nItem
VARIABLE Op1
double dop1
 dop1 = GETDOUBLEVALUE(Op1)
VARIABLE Op1
long iNumberOfDigits
long lop1
double Multiplier
double dop1
GET_ONE_ARG nItem = CDR(nItem)
 iNumberOfDigits = 0
 dop1 = GETDOUBLEVALUE(Op1)
 Multiplier = 1.0
END NOTIMPLEMENTED
END NODE nItem
VARIABLE Op1
GET_ONE_ARG RESULT = NEWMORTALLONG
END NODE nItem
VARIABLE Op1
GET_ONE_ARG RESULT = NEWMORTALLONG
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
RETURN_TRUE END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
RETURN_FALSE END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
RETURN_FALSE END VARIABLE ItemResult
NODE nItem
 USE_CALLER_MORTALS
 nItem = PARAMETERLIST
 ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 ASSERTOKE
 RESULT = NEWMORTALLONG
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED
END NOTIMPLEMENTED


Define Documentation

#define GET_ONE_ARG   USE_CALLER_MORTALS; nItem = PARAMETERLIST; Op1 = EVALUATEEXPRESSION(CAR(nItem)); NONULOP(Op1)
 

Definition at line 31 of file mathfunc.c.


Function Documentation

if memory_IsUndef(ItemResult)||(TYPE(ItemResult)==VTYPE_STRING &&STRLEN(ItemResult)==0)   ) 
 

Definition at line 1281 of file mathfunc.c.

if memory_IsUndef(ItemResult  ) 
 

Definition at line 1014 of file mathfunc.c.

if GETLONGVALUE(Op1)&  1  ) 
 

if iNumberOfDigits  = = 0  ) 
 

Definition at line 788 of file mathfunc.c.

References RETURN_DOUBLE_VALUE(), and RETURN_LONG_VALUE().

if nItem   ) 
 

Definition at line 776 of file mathfunc.c.

References ASSERTOKE.

if dop1  = = (double)lop1  ) 
 

Definition at line 682 of file mathfunc.c.

References RETURN_LONG_VALUE().

GET_ONE_ARG if TYPE(Op1 = = VTYPE_STRING  ) 
 

Definition at line 474 of file mathfunc.c.

References RESULT.

if  ) 
 

Definition at line 410 of file mathfunc.c.

GET_ONE_ARG if ISINTEGER(Op1  ) 
 

Definition at line 342 of file mathfunc.c.

else LONGVALUE RESULT   )  [pure virtual]
 

long* RaiseError pExecuteObject  pEo  ) 
 

Definition at line 85 of file mathops.c.

References NULL, options_GetR(), options_Set(), and RAISEMATHERROR.

RETURN_DOUBLE_VALUE dop1   ) 
 

RETURN_DOUBLE_VALUE dop1  ,
0.0?dop1:-  dop1
 

RETURN_DOUBLE_VALUE sqrt(dop1  ) 
 

Definition at line 414 of file mathfunc.c.

References RETURN_LONG_VALUE().

Referenced by if().

RETURN_DOUBLE_VALUE_OR_LONG acos(dop1  ) 
 

Definition at line 232 of file mathfunc.c.

RETURN_DOUBLE_VALUE_OR_LONG asin(dop1  ) 
 

Definition at line 202 of file mathfunc.c.

RETURN_DOUBLE_VALUE_OR_LONG log10(dop1  ) 
 

Definition at line 146 of file mathfunc.c.

RETURN_DOUBLE_VALUE_OR_LONG log(dop1  ) 
 

Definition at line 116 of file mathfunc.c.

GET_ONE_ARG RETURN_DOUBLE_VALUE_OR_LONG pow(10.0, GETDOUBLEVALUE(Op1))   ) 
 

Definition at line 61 of file mathfunc.c.

Referenced by if().

switch TYPE(ItemResult  ) 
 

Definition at line 929 of file mathfunc.c.

References LONGVALUE(), NULL, and RETURN.

while iNumberOfDigits--   ) 
 

Definition at line 798 of file mathfunc.c.


Variable Documentation

ASSERTOKE
 

Definition at line 1321 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1279 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1245 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1211 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1170 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1130 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1090 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1051 of file mathfunc.c.

ASSERTOKE
 

Definition at line 1012 of file mathfunc.c.

dop1 = GETDOUBLEVALUE(Op1)
 

Definition at line 787 of file mathfunc.c.

double dop1
 

Definition at line 769 of file mathfunc.c.

dop1 = GETDOUBLEVALUE(Op1)
 

Definition at line 730 of file mathfunc.c.

double dop1
 

Definition at line 722 of file mathfunc.c.

dop1 = floor(GETDOUBLEVALUE(Op1))
 

Definition at line 680 of file mathfunc.c.

double dop1
 

Definition at line 671 of file mathfunc.c.

dop1 = GETDOUBLEVALUE(Op1)
 

Definition at line 629 of file mathfunc.c.

double dop1
 

Definition at line 620 of file mathfunc.c.

dop1 = GETDOUBLEVALUE(Op1)
 

Definition at line 450 of file mathfunc.c.

dop1 = GETDOUBLEVALUE(Op1)
 

Definition at line 408 of file mathfunc.c.

double dop1
 

Definition at line 385 of file mathfunc.c.

double dop1
 

Definition at line 337 of file mathfunc.c.

double dResult
 

Definition at line 383 of file mathfunc.c.

double dResult
 

Definition at line 57 of file mathfunc.c.

iNumberOfDigits = 0
 

Definition at line 775 of file mathfunc.c.

long iNumberOfDigits
 

Definition at line 768 of file mathfunc.c.

int isneg
 

Definition at line 622 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1320 of file mathfunc.c.

RETURN_FALSE END VARIABLE ItemResult
 

TYPE =section test =display TYPE()

This function can be used to determine the type of an expression. The function returns a numeric value that describes the type of the argument. Although the numeric values are guaranteed to be the one defined here it is recommended that you use the predefined symbolic constant values to compare the return value of the function against. The function return value is the following

=itemize =item T<SbTypeUndef> 0 if the argument is T<undef>. =item T<SbTypeString> 1 if the argument is string. =item T<SbTypeReal> 2 if the argument is real. =item T<SbTypeInteger> 3 if the argument is integer. =item T<SbTypeArray> 4 if the argument is an array. =noitemize

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>.

Definition at line 1312 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1278 of file mathfunc.c.

RETURN_FALSE END VARIABLE ItemResult
 

ISEMPTY =section test =display ISEMPTY()

This function can be used to determine whether an expression holds an empty string. Because programmers tend to use the value T<undef> where empty string would be more precise the function returns T<true> if the argument is T<undef>. Precisely:

The function returns true if the argument is T<undef> or a string containing zero characters. Otherwise the function returns T<false>.

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<TYPE>.

Definition at line 1270 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1244 of file mathfunc.c.

RETURN_TRUE END VARIABLE ItemResult
 

ISUNDEF =section test =display ISUNDEF()

This function can be used to determine whether an expression is defined or undefined (aka T<undef>). If the argument is a defined value then the function returns T<false>, otherwise the function returns T<true>.

This function is the counter function of R<ISDEFINED>.

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISEMPTY>, R<TYPE>.

Definition at line 1236 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1210 of file mathfunc.c.

END VARIABLE ItemResult
 

ISDEFINED =section test =display IsDefined()

This function can be used to determine whether an expression is defined or undefined (aka T<undef>). If the argument is a defined value then the function returns T<true>, otherwise the function returns T<false>.

This function is the counter function of R<ISUNDEF>.

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1202 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1169 of file mathfunc.c.

END VARIABLE ItemResult
 

ISNUMERIC =section test =display ISNUMERIC()

This function can be used to determine whether an expression is numeric (real or integer) or some other type of value. If the argument is a real or an integer then the function returns T<true>, otherwise the function returns T<false>.

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1161 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1129 of file mathfunc.c.

END VARIABLE ItemResult
 

ISREAL =section test =display ISREAL()

This function can be used to determine whether an expression is real or some other type of value. If the argument is a real then the function returns T<true>, otherwise the function returns T<false>.

See also R<ISARRAY>, R<ISSTRING>, R<ISINTEGER>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1121 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1089 of file mathfunc.c.

END VARIABLE ItemResult
 

ISINTEGER =section test =display ISINTEGER()

This function can be used to determine whether an expression is integer or some other type of value. If the argument is an integer then the function returns T<true>, otherwise the function returns T<false>.

See also R<ISARRAY>, R<ISSTRING>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1081 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1050 of file mathfunc.c.

END VARIABLE ItemResult
 

ISSTRING =section string test =display ISSTRING()

This function can be used to determine whether an expression is string or some other type of value. If the argument is a string then the function returns T<true>, otherwise the function returns T<false>.

See also R<ISARRAY>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1042 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 1011 of file mathfunc.c.

END VARIABLE ItemResult
 

ISARRAY =section array test =display ISARRAY()

This function can be used to determine whether a variable holds array value or ordinary value. If the variable passed as argument to the function is an array then the function returns T<true>, otherwise the function returns T<false>.

See also R<ISSTRING>, R<ISINTEGER>, R<ISREAL>, R<ISNUMERIC>, R<ISDEFINED>, R<ISUNDEF>, R<ISEMPTY>, R<TYPE>.

Definition at line 1003 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 971 of file mathfunc.c.

END VARIABLE ItemResult
 

UBOUND =section array =display UBOUND()

This function can be used to determine the highest occupied index of an array. Note that arrays are increased in addressable indices automatically, thus it is not an error to use a higher index that the value returned by the function T<UBOUND>. On the other hand all the element having index larger than the returned value are T<undef>.

The argument of this function has to be an array. If the argument is an ordinary value, or a variable that is not an array the value returned by the function will be T<undef>.

T<UBOUND(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

See also R<LBOUND>.

Definition at line 963 of file mathfunc.c.

ItemResult = _EVALUATEEXPRESSION_A(CAR(nItem))
 

Definition at line 926 of file mathfunc.c.

END VARIABLE ItemResult
 

LBOUND =section array =display LBOUND()

This function can be used to determine the lowest occupied index of an array. Note that arrays are increased in addressable indices automatically, thus it is not an error to use a lower index that the value returned by the function T<LBOUND>. On the other hand all the element having index lower than the returned value are T<undef>.

The argument of this function has to be an array. If the argument is an ordinary value, or a variable that is not an array the value returned by the function will be T<undef>.

T<LBOUND(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

See also R<UBOUND>.

Definition at line 918 of file mathfunc.c.

long lop1
 

Definition at line 768 of file mathfunc.c.

lop1 = (long)dop1
 

Definition at line 681 of file mathfunc.c.

long lop1
 

Definition at line 672 of file mathfunc.c.

long lop1
 

Definition at line 621 of file mathfunc.c.

long lop1
 

Definition at line 384 of file mathfunc.c.

long lop1
 

Definition at line 338 of file mathfunc.c.

long lSquare
 

Definition at line 384 of file mathfunc.c.

Multiplier = 1.0
 

Definition at line 797 of file mathfunc.c.

double Multiplier
 

Definition at line 769 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1319 of file mathfunc.c.

NODE nItem
 

Definition at line 1313 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1277 of file mathfunc.c.

NODE nItem
 

Definition at line 1271 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1243 of file mathfunc.c.

NODE nItem
 

Definition at line 1237 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1209 of file mathfunc.c.

NODE nItem
 

Definition at line 1203 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1168 of file mathfunc.c.

NODE nItem
 

Definition at line 1162 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1128 of file mathfunc.c.

NODE nItem
 

Definition at line 1122 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1088 of file mathfunc.c.

NODE nItem
 

Definition at line 1082 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1049 of file mathfunc.c.

NODE nItem
 

Definition at line 1043 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 1010 of file mathfunc.c.

NODE nItem
 

Definition at line 1004 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 970 of file mathfunc.c.

NODE nItem
 

Definition at line 964 of file mathfunc.c.

nItem = PARAMETERLIST
 

Definition at line 925 of file mathfunc.c.

NODE nItem
 

Definition at line 919 of file mathfunc.c.

END NODE nItem
 

EVEN =display EVEN() =section math test Return T<true> if the argument is an even number. T<EVEN(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

See also R<ODD>.

Definition at line 885 of file mathfunc.c.

END NODE nItem
 

ODD =section math test =display ODD()

Return T<true> if the argument is an odd number. T<ODD(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

See also R<EVEN>

Definition at line 857 of file mathfunc.c.

GET_ONE_ARG nItem = CDR(nItem)
 

Definition at line 773 of file mathfunc.c.

END NODE nItem
 

FRAC =display FRAC() =section math

The function returns the fractional part of the argument. This function always returns a double except that T<FRAC(undef)> may return T<undef>. T<FRAC(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

Negative arguments return negative value (or zero if the argument is a negative integer), positive arguments result positive values (or zero if the argument is integer).

Definition at line 720 of file mathfunc.c.

END NODE nItem
 

INT =display INT() =section math

This function returns the integral part of the argument. T<INT(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>. Other than this the function returns integer value.

The difference between T<INT> and T<FIX> is that T<INT> truncates down while T<FIX> truncates towards zero. The two functions are identical for positive numbers. In case of negative arguments T<INT> will give a smaller number if the argument is not integer. For example:

=verbatim int(-3.3) = -4 fix(-3.3) = -3 =noverbatim

See R<FIX>.

Definition at line 669 of file mathfunc.c.

END NODE nItem
 

FIX =display FIX() =section math

This function returns the integral part of the argument. The return value of the function is integer with the exception that T<FIX(undef)> may return T<undef>.

T<FIX(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

The difference between T<INT> and T<FIX> is that T<INT> truncates down while T<FIX> truncates towards zero. The two functions are identical for positive numbers. In case of negative arguments T<INT> will give a smaller number if the argument is not integer. For example:

=verbatim int(-3.3) = -4 fix(-3.3) = -3 =noverbatim

See R<INT>.

Definition at line 618 of file mathfunc.c.

END NODE nItem
 

VAL =display VAL() =section math

Converts a string to numeric value. If the string is integer it returns an integer value. If the string contains a number presentation which is a float number the returned value is real. In case the argument is already numeric no conversion is done.

T<VAL(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

Definition at line 469 of file mathfunc.c.

END NODE nItem
 

SQR =section math =display SQR()

Calculates the square root of the argument.

If the result is within the range of an integer value on the actual architecture then the result is returned as an integer, otherwise it is returned as a real value.

T<SQR(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

If the argument is a negative number the result of the function is T<undef> or the function raises error if the option T<RaiseMathError> has the bit T<sbMathErrDiv> set.

If the square root of the argument is an integer number then the function returns an integer number. In other cases the returned value is real even if the argument itself is integer.

Note that this function has the opposite meaning in the language PASCAL, namely the square of the number. This may cause some problem if you are experienced in PASCAL programming. In that language T<SQRT> notes the square I<root> of a number.

Definition at line 354 of file mathfunc.c.

NODE nItem
 

POW =section math =display POW()

Calculates the x-th exponent of 10. If the result is within the range of an integer value on the actual architecture then the result is returned as an integer, otherwise it is returned as a real value.

T<POW(undef)> is T<undef> or raises an error if the option T<RaiseMatherror> is set in bit T<sbMathErrUndef>.

Definition at line 55 of file mathfunc.c.

END NOTIMPLEMENTED
 

IMIN =section planned =display IMIN()

This is a planned function to select and return the index of the minimum of the arguments.

Definition at line 1651 of file mathfunc.c.

END NOTIMPLEMENTED
 

IMAX =section planned =display IMAX()

This is a planned function to select and return the index of the maximum of the arguments.

Definition at line 1637 of file mathfunc.c.

END NOTIMPLEMENTED
 

MIN =section planned =display MIN()

This is a planned function to select and return the minimum of the arguments.

Definition at line 1623 of file mathfunc.c.

END NOTIMPLEMENTED
 

MAX =section planned =display MAX()

This is a planned function to select and return the maximum of the arguments.

Definition at line 1609 of file mathfunc.c.

END NOTIMPLEMENTED
 

HCOSECANT =section planned =display HCOSECANT()

This is a planned function to calculate the cosecant hyperbolicus of the argument.

Definition at line 1595 of file mathfunc.c.

END NOTIMPLEMENTED
 

HSECANT =section planned =display HSECANT()

This is a planned function to calculate the secant hyperbolicus of the argument.

Definition at line 1580 of file mathfunc.c.

END NOTIMPLEMENTED
 

HCTAN =section planned =display HCTAN()

This is a planned function to calculate the cotangent hyperbolicus of the argument.

Definition at line 1565 of file mathfunc.c.

END NOTIMPLEMENTED
 

HTAN =section planned =display HTAN()

This is a planned function to calculate the tangent hyperbolicus of the argument.

Definition at line 1550 of file mathfunc.c.

END NOTIMPLEMENTED
 

HCOS =section planned =display HCOS()

This is a planned function to calculate the cosinus hyperbolicus of the argument.

Definition at line 1535 of file mathfunc.c.

END NOTIMPLEMENTED
 

HSIN =section planned =display HSIN()

This is a planned function to calculate the sinus hyperbolicus of the argument.

Definition at line 1520 of file mathfunc.c.

END NOTIMPLEMENTED
 

ACOSECANT =section planned =display ACOSECANT()

This is a planned function to calculate the arcus cosecant of the argument.

Definition at line 1505 of file mathfunc.c.

END NOTIMPLEMENTED
 

ASECANT =section planned =display ASECANT()

This is a planned function to calculate the arcus secant of the argument.

Definition at line 1490 of file mathfunc.c.

END NOTIMPLEMENTED
 

COSECANT =section planned =display COSECANT()

This is a planned function to calculate the cosecant of the argument.

Definition at line 1475 of file mathfunc.c.

END NOTIMPLEMENTED
 

SECANT =section planned =display SECANT()

This is a planned function to calculate the secant of the argument.

Definition at line 1460 of file mathfunc.c.

END NOTIMPLEMENTED
 

ACTAN =section planned =display ACTAN()

This is a planned function to calculate the arcus cotangent of the argument.

Definition at line 1445 of file mathfunc.c.

END NOTIMPLEMENTED
 

COTAN2 =section planned =display COTAN2()

This is a planned function to calculate the cotangent of the ratio of the two arguments.

Definition at line 1430 of file mathfunc.c.

END NOTIMPLEMENTED
 

COTAN =section planned =display COTAN()

This is a planned function to calculate the cotangent of the argument.

Definition at line 1415 of file mathfunc.c.

END NOTIMPLEMENTED
 

TAN2 =section planned =display TAN2()

This is a planned function to calculate the tangent of the ratio of the two arguments.

Definition at line 1400 of file mathfunc.c.

END NOTIMPLEMENTED
 

TAN =section planned =display TAN()

This is a planned function to calculate the tangent of the argument.

Definition at line 1385 of file mathfunc.c.

END NOTIMPLEMENTED
 

ATAN =section planned =display ATAN()

This is a planned function to calculate the arcus tangent of the argument.

Definition at line 1371 of file mathfunc.c.

END NOTIMPLEMENTED
 

ATN =section planned =display ATN()

This is a planned function to calculate the arcus tangent of the argument.

Definition at line 1357 of file mathfunc.c.

END NOTIMPLEMENTED
 

LCM =section math =display LCM()

This is a planned function that takes two or more integer argument and calculates the least common multiple of them.

Definition at line 824 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 886 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 858 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 766 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 721 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 670 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 619 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 470 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 382 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 335 of file mathfunc.c.

VARIABLE Op1
 

Definition at line 56 of file mathfunc.c.

RESULT = NEWMORTALLONG
 

Definition at line 1323 of file mathfunc.c.

GET_ONE_ARG RESULT = NEWMORTALLONG
 

Definition at line 890 of file mathfunc.c.

GET_ONE_ARG RESULT = NEWMORTALLONG
 

Definition at line 862 of file mathfunc.c.

RESULT = NULL
 

Definition at line 552 of file mathfunc.c.

long result
 

Definition at line 338 of file mathfunc.c.

Referenced by app(), doublepow(), longpow(), and memory_CopyArray().

USE_CALLER_MORTALS
 

Definition at line 1316 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1274 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1240 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1206 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1165 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1125 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1085 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1046 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 1007 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 967 of file mathfunc.c.

USE_CALLER_MORTALS
 

Definition at line 922 of file mathfunc.c.

END USE_CALLER_MORTALS
 

FALSE =section math

This built-in constant is implemented as an argument less function. Returns the value T<false>.

Definition at line 587 of file mathfunc.c.

END USE_CALLER_MORTALS
 

TRUE =section math

This built-in constant is implemented as an argument less function. Returns the value T<true>.

Definition at line 569 of file mathfunc.c.

END USE_CALLER_MORTALS
 

Definition at line 550 of file mathfunc.c.

END USE_CALLER_MORTALS
 

PI =section math =display PI This built-in constant is implemented as an argument less function. Returns the approximate value of the constant PI which is the ratio of the circumference of a circle to its diameter.

Definition at line 536 of file mathfunc.c.

END USE_CALLER_MORTALS
 

MININT =section math =display MININT

This built-in constant is implemented as an argument less function. Returns the minimal ("maximal negative") number that can be stored as an integer value.

Definition at line 498 of file mathfunc.c.


Generated on Sun Mar 12 23:56:33 2006 for ScriptBasic by  doxygen 1.4.6-NO