Real numbers support the regular arithmetic operators that are the addition, the subtraction, the multiplication, and the division. Decimal numbers support the operation that consists of raising one number to the power of another number. This is done using the ** operator. Here is an example: ```
let a = 8.25
let b = 5.14
let power = a ** b
```
This operation is not supported on natural numbers. If you
want to perform it on integers, simply add .00 to each number or convert each
number to
The F# language provides a series of functions you can use in your programs. The numbers in your program can be
positive or negative. A negative number is preceded by a - sign. To find the
sign of a number, call a function named - If the value of the argument is positive, the function returns 1
- If the value of the argument is negative, the function returns -1
- If the value of the argument is 0, the function returns 0
To find the absolute value of a number or a variable, use the The - If the value of the first (left) argument is lower than the value of the second (right) argument, the function returns -1
- If the value of the first (left) argument is equal to the value of the second (right) argument, the function returns 0
- If the value of the first (left) argument is higher than that of the second (right) argument, the function returns 1
To calculate the natural logarithm of a floating-point number, call a
function named To calculate the logarithm to base 10 of a decimal number,
call the
To round a number, call a function named To truncate a number, call a function named To find the ceiling of a number, call the To calculat the power of a number raised to a power, use a
function named To calculate the exponential of a function, call a function
named To calculate the square root of a number, call the
If you have a decimal number and you want to find its
sine, the F# language provides a function named let result = sin 228.82 sprintf "The sine of 128 is %.3f" result This would produce: The sine of 128 is 0.494 To get the inverse sine of a function, call the To let you calculate the cosine of a decimal number, the F#
language is equipped with a function
named To get the inverse cosine of a number, call the To calculate the tangent of a number, call a function named
On the other hand, if you have a fraction represented as x / y, to get
its inverse tangent, call the |