#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include "../command.h"
Go to the source code of this file.
Defines | |
#define | RAISEMATHERROR "raisematherror" |
#define | LOGOP(NAME, OP) |
#define | NOCOMMAND(XXX) |
#define | LONGOP(NAME, OP) |
Functions | |
static int | STRCMP (pExecuteObject pEo, VARIABLE Op1, VARIABLE Op2, int iCase) |
static long | longpow (long a, long b) |
static double | doublepow (double a, long b) |
long * | RaiseError (pExecuteObject pEo) |
if (!ISINTEGER(Op1)||!ISINTEGER(Op2)) | |
if (0==lop1) | |
if (lResult/lop1==lop2) | |
RETURN_DOUBLE_VALUE_OR_LONG (GETDOUBLEVALUE(Op1)*GETDOUBLEVALUE(Op2)) | |
if (memory_IsUndef(Op1)||memory_IsUndef(Op2)) | |
if (TYPE(Op1)==VTYPE_STRING||TYPE(Op2)==VTYPE_STRING) | |
RETURN_LONG_VALUE (GETLONGVALUE(Op1)==GETLONGVALUE(Op2)?-1L:0L) | |
RETURN_LONG_VALUE (GETLONGVALUE(Op1)!=GETLONGVALUE(Op2)?-1L:0L) | |
if (nItem) | |
if (ISINTEGER(Op1)) | |
RETURN_DOUBLE_VALUE_OR_LONG (GETLONGVALUE(Op1)) | |
if (!ISINTEGER(Op1)) | |
RETURN_LONG_VALUE (-GETLONGVALUE(Op1)) ENDNODE nItem | |
RETURN_LONG_VALUE (~GETLONGVALUE(Op1)) ENDNODE nItem | |
if (memory_IsUndef(vMantissa)) | |
if (memory_IsUndef(vExponent)) | |
if (bExpIsInt) | |
if (lop2==0) | |
RETURN_LONG_VALUE (((long)(lop1/lop2))) | |
if (lop1%lop2) | |
Variables | |
NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
double | dResult |
long | lResult |
long | lop1 |
long | lop2 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
nItem = CDR(nItem) | |
Op2 = EVALUATEEXPRESSION(CAR(nItem)) | |
lop1 = GETLONGVALUE(Op1) | |
lop2 = GETLONGVALUE(Op2) | |
lResult = lop1 * lop2 | |
END NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
double | dResult |
long | lResult |
long | lop1 |
long | lop2 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
nItem = CDR(nItem) | |
VARIABLE | Op1 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
VARIABLE | vMantissa |
VARIABLE | vExponent |
double | dMantissa |
double | dExponent |
double | dRoot |
double | dResult |
long | lMantissa |
long | lExponent |
long | lRoot |
int | bMantIsInt |
int | bExpIsInt |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
vMantissa = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
vExponent = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
bMantIsInt = ISINTEGER(vMantissa) | |
bExpIsInt = ISINTEGER(vExponent) | |
VARIABLE | Op1 |
VARIABLE | Op2 |
double | dop1 |
double | dop2 |
long | lop1 |
long | lop2 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
nItem = CDR(nItem) | |
Op2 = EVALUATEEXPRESSION(CAR(nItem)) | |
lop1 = GETLONGVALUE(Op1) | |
lop2 = GETLONGVALUE(Op2) | |
lop1 = GETLONGVALUE(Op1) | |
lop2 = GETLONGVALUE(Op2) | |
END VARIABLE | Op1 |
USE_CALLER_MORTALS | |
Op1 = EVALUATEEXPRESSION(CAR(PARAMETERLIST)) | |
ASSERTOKE | |
RESULT = Op1 |
|
Referenced by RETURN_LONG_VALUE(). |
|
Value: COMMAND(NAME)\ NODE nItem;\ VARIABLE Op1,Op2;\ USE_CALLER_MORTALS;\ nItem = PARAMETERLIST;\ Op1 = EVALUATEEXPRESSION(CAR(nItem));\ NONULOP(Op1)\ nItem = CDR(nItem);\ Op2 = EVALUATEEXPRESSION(CAR(nItem));\ NONULOP(Op2)\ RETURN_LONG_VALUE( GETLONGVALUE(Op1) OP GETLONGVALUE(Op2) )\ END Referenced by RETURN_LONG_VALUE(). |
|
Value: COMMAND(XXX)\ NOTIMPLEMENTED;\ END |
|
Definition at line 84 of file mathops.c. Referenced by RaiseError(). |
|
Definition at line 72 of file mathops.c. References result. Referenced by if(). |
|
Definition at line 868 of file mathops.c. References RETURN_DOUBLE_VALUE(). |
|
|
|
Definition at line 672 of file mathops.c. References doublepow(), longpow(), NULL, RESULT, RETURN, RETURN_DOUBLE_VALUE(), and RETURN_LONG_VALUE(). |
|
|
|
|
|
Definition at line 584 of file mathops.c. References RETURN_DOUBLE_VALUE_OR_LONG(). |
|
Definition at line 514 of file mathops.c. References RETURN_LONG_VALUE(). |
|
Definition at line 472 of file mathops.c. References RETURN_DOUBLE_VALUE_OR_LONG(), and RETURN_LONG_VALUE(). |
|
Definition at line 185 of file mathops.c. References pEo, RETURN_LONG_VALUE(), and STRCMP(). |
|
Definition at line 180 of file mathops.c. References RETURN_LONG_VALUE(). |
|
Definition at line 146 of file mathops.c. References RETURN_LONG_VALUE(). |
|
Definition at line 143 of file mathops.c. References RETURN_LONG_VALUE(). |
|
Definition at line 137 of file mathops.c. References RETURN_DOUBLE_VALUE_OR_LONG(). |
|
Definition at line 60 of file mathops.c. References result. Referenced by if(). |
|
Definition at line 85 of file mathops.c. References NULL, options_GetR(), options_Set(), and RAISEMATHERROR. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 196 of file mathops.c. Referenced by if(), and RETURN_DOUBLE_VALUE(). |
|
Definition at line 31 of file mathops.c. References memory_IsUndef(), STRINGVALUE(), and STRLEN(). Referenced by execute_LeftValueSarray(), and if(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|