How to resolve the algorithm Real constants and functions step by step in the ERRE programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Real constants and functions step by step in the ERRE programming language

Table of Contents

Problem Statement

Show how to use the following math constants and functions in your language   (if not available, note it):

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Real constants and functions step by step in the ERRE programming language

Source code in the erre programming language

PROGRAM R_C_F

FUNCTION CEILING(X)
   CEILING=INT(X)-(X-INT(X)>0)
END FUNCTION

FUNCTION FLOOR(X)
   FLOOR=INT(X)
END FUNCTION

BEGIN
     PRINT(EXP(1))           ! e  not available
     PRINT(π)                ! pi is available or ....
     PRINT(4*ATN(1))         ! .... equal to

     X=12.345
     Y=1.23

     PRINT(SQR(X),X^0.5)     ! square root
     PRINT(LOG(X))           ! natural logarithm base e
     PRINT(LOG(X)/LOG(10))   ! base 10 logarithm
     PRINT(LOG(X)/LOG(Y))    ! arbitrary base logarithm (y>0)
     PRINT(EXP(X))           ! exponential
     PRINT(ABS(X))           ! absolute value
     PRINT(FLOOR(X))         ! floor
     PRINT(CEILING(X))       ! ceiling
     PRINT(X^Y)              ! power
END PROGRAM

  

You may also check:How to resolve the algorithm Increment a numerical string step by step in the Forth programming language
You may also check:How to resolve the algorithm Sparkline in unicode step by step in the M2000 Interpreter programming language
You may also check:How to resolve the algorithm Trigonometric functions step by step in the FutureBasic programming language
You may also check:How to resolve the algorithm Determine if a string has all the same characters step by step in the Haskell programming language
You may also check:How to resolve the algorithm MD5/Implementation step by step in the Modula-3 programming language