Class SysMath

java.lang.Object
svm.env.SysMath

public abstract class SysMath extends Object

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
    Constructor
    Description
    Default Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Long real Arctangent
    static void
    Long real Cosine
    static void
    Long real Addepsilon
    static void
    Long real raised to the long real power
    static void
    Long real raised to the integer power
    static void
    Real Logaritm base 10
    static void
    Long real Subepsilon
    static void
    Real Exponentiation
    static void
    Integer raised to the integer power
    private static int
    IPOW(long base, long x)
    Utility: Integer Power: b ** x
    static void
    Long real natural logarithm
    static void
    Integer modulo operation
    static void
    Real Addepsilon
    static void
    Real Arctangent
    static void
    Real Cosine
    static void
    Real Exponentiation
    static void
    Real raised to the integer power
    static void
    Real natural logarithm
    static void
    Real raised to the real power
    static void
    Real Sine
    static void
    Real Square root
    static void
    Real Subepsilon
    private static int
    sign(int arg)
    Utility: sign
    static void
    Long real Sine
    static void
    Long real Square root

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 base
      x - 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The 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 →
         ..., result
      

      The result, which is pushed onto the Runtime stack, is the Arctangent of the argument 'arg'