How to resolve the algorithm Real constants and functions step by step in the UNIX Shell programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Real constants and functions step by step in the UNIX Shell 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 UNIX Shell programming language
Source code in the unix programming language
echo $(( exp(1) )) # e
echo $(( acos(-1) )) # PI
x=5
echo $(( sqrt(x) )) # square root
echo $(( log(x) )) # logarithm base e
echo $(( log2(x) )) # logarithm base 2
echo $(( log10(x) )) # logarithm base 10
echo $(( exp(x) )) # exponential
x=-42
echo $(( abs(x) )) # absolute value
x=-5.5
echo $(( floor(x) )) # floor
echo $(( ceil(x) )) # ceiling
x=10 y=3
echo $(( pow(x,y) )) # power
You may also check:How to resolve the algorithm Date format step by step in the Logo programming language
You may also check:How to resolve the algorithm Mandelbrot set step by step in the BASIC programming language
You may also check:How to resolve the algorithm Reverse a string step by step in the LLVM programming language
You may also check:How to resolve the algorithm Hofstadter Q sequence step by step in the OCaml programming language
You may also check:How to resolve the algorithm Arithmetic/Integer step by step in the Quackery programming language