Class SysMath
Mathematical library procedures
The following mathematical library routines are defined to cover the same standard procedures in SIMULA.
These routines may change the value of the global variable status to one of the values given in appendix C.
The routines correspond to the similarly named SIMULA Standard functions.
Link to GitHub: Source File.
- Author:
- Simula Standard, S-Port: The Environment Interface, Øystein Myhre Andersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidarctan()Long real Arctangentstatic voidcosinu()Long real Cosinestatic voiddaddep()Long real Addepsilonstatic voidddpowr()Long real raised to the long real powerstatic voiddipowr()Long real raised to the integer powerstatic voiddlog10()Real Logaritm base 10static voiddsubep()Long real Subepsilonstatic voidexpone()Real Exponentiationstatic voidiipowr()Integer raised to the integer powerprivate static intIPOW(long base, long x) Utility: Integer Power: b ** xstatic voidlogari()Long real natural logarithmstatic voidmodulo()Integer modulo operationstatic voidraddep()Real Addepsilonstatic voidrartan()Real Arctangentstatic voidrcosin()Real Cosinestatic voidrexpon()Real Exponentiationstatic voidripowr()Real raised to the integer powerstatic voidrlogar()Real natural logarithmstatic voidrrpowr()Real raised to the real powerstatic voidrsinus()Real Sinestatic voidrsqroo()Real Square rootstatic voidrsubep()Real Subepsilonprivate static intsign(int arg) Utility: signstatic voidsinusr()Long real Sinestatic voidsqroot()Long real Square root
-
Constructor Details
-
SysMath
public SysMath()Default Constructor
-
-
Method Details
-
raddep
public static void raddep()Real Addepsilon
Visible sysroutine("RADDEP") RADDEP; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument incremented by the smallest positive value, such that the result is not equal to the argument within the precision of the implementation.
Thus, for all positive values of "eps",
E-eps <= subepsilon(E) < E < addepsilon(E) <= E+eps -
daddep
public static void daddep()Long real Addepsilon
Visible sysroutine("DADDEP") DADDEP; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument incremented by the smallest positive value, such that the result is not equal to the argument within the precision of the implementation.
Thus, for all positive values of "eps",
E-eps <= subepsilon(E) < E < addepsilon(E) <= E+eps -
rsubep
public static void rsubep()Real Subepsilon
Visible sysroutine("RSUBEP") RSUBEP; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument decremented by the smallest positive value, such that the result is not equal to the argument within the precision of the implementation.
Thus, for all positive values of "eps",
E-eps <= subepsilon(E) < E < addepsilon(E) <= E+eps -
dsubep
public static void dsubep()Long real Subepsilon
Visible sysroutine("DSUBEP") DSUBEP; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument decremented by the smallest positive value, such that the result is not equal to the argument within the precision of the implementation.
Thus, for all positive values of "eps",
E-eps <= subepsilon(E) < E < addepsilon(E) <= E+eps -
iipowr
public static void iipowr()Integer raised to the integer power
Visible sysroutine("IIPOWR") IIPOWR; --- v:=b**x import integer b,x; export integer v end; Runtime Stack ..., b, x → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument 'b' raised to the 'x' power
-
modulo
public static void modulo()Integer modulo operation
Visible sysroutine("MODULO") MOD; import integer x,y; export integer val end; Runtime Stack ..., x, y → ..., resultThe modulo operator in Java, denoted by the percent sign (%), calculates the remainder of a division operation.
It is used with the following syntax:operand1 % operand2,where operand1 is the dividend and operand2 is the divisor.
The result, which is pushed onto the Runtime stack, is the remainder when operand1 is divided by operand2.
Simula Standard:
integer procedure mod(i,j); integer i,j; begin integer res; res := i - (i//j)*j; mod := if res = 0 then 0 else if sign(res) <> sign(j) then res+j else res end mod;The result is the mathematical modulo value of the arguments.
-
sign
private static int sign(int arg) Utility: sign- Parameters:
arg- the argument- Returns:
- +1 if arg > 0, otherwise -1
-
IPOW
private static int IPOW(long base, long x) Utility: Integer Power: b ** x- Parameters:
base- argument basex- argument x- Returns:
- Returns the value of 'base' raised to the power of 'x'
-
ripowr
public static void ripowr()Real raised to the integer power
Visible sysroutine("RIPOWR") RIPOWR; --- v:=b**x import real b; integer x; export real v end; Runtime Stack ..., b, x → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument 'b' raised to the 'x' power
-
rrpowr
public static void rrpowr()Real raised to the real power
Visible sysroutine("RRPOWR") RRPOWR; --- v:=b**x import real b; real x; export real v end; Runtime Stack ..., b, x → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument 'b' raised to the 'x' power
-
dipowr
public static void dipowr()Long real raised to the integer power
Visible sysroutine("DIPOWR") DIPOWR; --- v:=b**x import long real b; integer x; export long real v end; Runtime Stack ..., b, x → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument 'b' raised to the 'x' power
-
ddpowr
public static void ddpowr()Long real raised to the long real power
Visible sysroutine("DDPOWR") DDPOWR; --- v:=b**x import long real b; long real x; export long real v end; Runtime Stack ..., b, x → ..., resultThe result, which is pushed onto the Runtime stack, is the value of the argument 'b' raised to the 'x' power
-
rsqroo
public static void rsqroo()Real Square root
Visible sysroutine("RSQROO") RSQROO; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Square root of the argument 'arg'
-
sqroot
public static void sqroot()Long real Square root
Visible sysroutine("SQROOT") SQROOT; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Square root of the argument 'arg'
-
rlogar
public static void rlogar()Real natural logarithm
Visible sysroutine("RLOGAR") RLOGAR; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Logaritms of the argument 'arg'
-
logari
public static void logari()Long real natural logarithm
Visible sysroutine("LOGARI") LOGARI; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Logaritms of the argument 'arg'
-
dlog10
public static void dlog10()Real Logaritm base 10
Visible sysroutine("DLOG10") DLOG10; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Log10 of the argument 'arg'
-
rexpon
public static void rexpon()Real Exponentiation
Visible sysroutine("REXPON") REXPON; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Exponentiation of the argument 'arg'
-
expone
public static void expone()Real Exponentiation
Visible sysroutine("EXPONE") EXPONE; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Exponentiation of the argument 'arg'
-
rsinus
public static void rsinus()Real Sine
Visible sysroutine("RSINUS") RSINUS; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Sine of the argument 'arg'
-
sinusr
public static void sinusr()Long real Sine
Visible sysroutine("SINUSR") SINUSR; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Sine of the argument 'arg'
-
rcosin
public static void rcosin()Real Cosine
Visible sysroutine("RCOSIN") RCOSIN; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Cosine of the argument 'arg'
-
cosinu
public static void cosinu()Long real Cosine
Visible sysroutine("COSINU") COSINU; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Cosine of the argument 'arg'
-
rartan
public static void rartan()Real Arctangent
Visible sysroutine("RARTAN") RARTAN; import real arg; export real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Arctangent of the argument 'arg'
-
arctan
public static void arctan()Long real Arctangent
Visible sysroutine("RARTAN") RARTAN; import long real arg; export long real val end; Runtime Stack ..., arg → ..., resultThe result, which is pushed onto the Runtime stack, is the Arctangent of the argument 'arg'
-