Beruflich Dokumente
Kultur Dokumente
These are the pre compiled programs which takes input called as arguments. These arguments
can be any data types and a function can return only one value which can be any data type
using the function name.
(i) abs(N1)
returns the magnitude of N1
eg abs(10) 10
abs(-10) 10
(ii) sign(N1)
returns +1(N1>0)
-1(N1<0)
0(N1=0)
eg sign(10) 1
sign(-10) -1
sign(0) 0
(iii) sqrt(N1)
returns the square root of N1
eg: sqrt(100) 10
(iv) power(N1,N2)
returns N1 ^ N2
eg: power(2,3) 8
power(3,2) 9
(v) mod(N1,N2)
returns remainder of N1/N2
eg: mod(10,2) 0
mod(10,3) 1
mod(2,10) 2
(vi) log(N1,N2)
returns logarithmic value of N2 to the base N1
eg: log(10,100) 2
log(2,16) 4
log(100,10) 0.5
(vii) ln(N1)
returns the logarithmic value of N1 to the base e(e=3.7182)
eg ln(20) = log(e,20) 3
(viii) exp(N1)
returns exponential of N1 (e ^ N1)
eg: exp(3) e ^ 3 20
(ix) sin(N1)
(x) cos(N1)
(xi) tan(N1)
where N1 in Radians
returns N1 in radians
(xiii) trunc(N1,[N2])
return N1 by truncating it to N2 position (default is 0)
eg: trunc(12.456,2) 12.45
trunc(12.456,1) 12.4
trunc(12.456,0) or trunc(12.456) 12
trunc(12.456,-1) 10
trunc(156.345,-2) 100
(xiv) ceil(N1)
returns the next integer value >=N1
eg:
ceil(12.456) 13
ceil(12.00001) 13
ceil(12) 12
(xv) floor(N1)
returns the previous integer value <= N1
eg:
floor(12.456) 12
floor(12.99999) 12
floor(12) 12