Saturday 22 October 2011

Math Function

Hello again all ... How are you ??? Fine ????
OK , let's start . Now we will study about Mathematical Function in Pascal.
Pascal Have some math function like : ...
1. Abs(x) : to get the absolute value from x.
2. Arctan(x) : to get the arctan value from x.
3. cos(x) : to get the cosinus value from x.
4. exp(x) : to get the exponential value from x.
5. frac(x) : to get the fraction value from x.
6. Int(x) : to get the integer value from x , that the result is real.
7. Ln(x) : to get the natural logaritmic value from x.
8. Pi : to get the pi value (22/7).
9. Round(x) : to get the rounding number value from x.
10. Sin(x) : to get the sinus value from x.
11. sqr(x) : to get the square value of x.
12. sqrt(x) : to get the square root value from x.
13. trunc(x) : to get the integer value from x , that the result is longint.

How to use it ???
x is a number or variabel.

the important note is , when the result is fraction , you must give the limit of the number behind the coma . like this :
writeln(x : 6 : 2);
6 is the length of character (coma included)
2 is the limit of number behind the coma.

i have make some example for you . you can see in this picture :


I think only that i can tell to you now , we can continue in the next post , byeeee...........

No comments:

Post a Comment