
Euler's Number in Scilab
Within the Scilab computational environment, you'll find Euler's number, e=2.7182818, handily encapsulated within the constant %e.
%e
This constant %e can be freely utilized in any mathematical calculation, operating much like our well-known friend, %pi.
But should you prefer an alternative, you've got one. The exp() function serves as a valid substitute, accepting 1 as its argument, effectively giving you the same result as %e. This can be executed as: exp(1).
exp(1)
Regardless of the approach, whether you opt for %e or exp(1), you're landing right back at Euler's number, e=2.7182818.
$$ e=2.7182818 $$
Now, let's bring this into the realm of practical application.
We're going to employ Euler's number, represented by %e, to compute the exponential of a number. For this example, our mission is to compute e2:
Start by assigning the exponent 2 to the variable x.
x = 2
Next, we roll up our sleeves and calculate the exponential, e2.
disp(%e^x)
And voila! The outcome is the square of Euler's number, rounding out to roughly 7.389.
7.3890561