MATH FUNCTIONS IN VBSCRIPT

Math Functions:

1.Abs(number):-Returns the absolute value of the number
Syntax: Abs(x)
Example                      Output
Abs(-3)                         3
Abs(3)                          3
Abs(0)                          0
2.Cos(angle)-Returns the cosine of the angle
Syntax: Cos(x)
Example                      Output
Cos(50)                                    0.9649
3.Sin(angle)-Returns the sine value of the angle
Syntax: Sin(x)
Example                      Output
Sin(47)                         0.1235
4.Tan(angle)-Returns the tangent value of the angle.
Syntax: Tan(x)
Example                      Output
Tan(40)                                    -1.1172149309239 
5.Sqr(x)-Returns square root of the number 
Syntax: Sqr(x)
Example                      Output
Sqr(9)                          3
6.Sgn(x)-Returns an integer that indicates the sign of the given number
Syntax: Sgn(x)
Example                      Output
Sqr(9)                          1
Sgn(-9)         -1
Sgn(0)               0
7.Rnd-Returns a random number less than 1 but greater than or equal to 0
Syntax: Rnd()
Example                      Output
Rnd()                           0.7055
8.Oct(x)-Returns an octal value of the given number
Syntax: Oct(x)
Example                      Output
Oct(3)                          3
Oct(460)                      714
Oct(9)                          11
9.Log(x)-Returns the natural logarithm of  x
Syntax: Log(x)
Example                      Output
Log(38.256783227) 3.64432088381777
10. Fix(x)-Returns the integer part of the number
Syntax: Fix(x)
Example                      Output
Fix(6. 83227)             6
Fix(6. 33227)             6
11.Int(x)-Returns the integer part of the number
Syntax: Int(x)
Example                      Output
Int(6. 83227)             6
Int(6. 33227)             6
Fix(-6. 83227)                       -6
Fix(-6. 33227)                       -6
12.Hex(x)-Returns the hexadecimal value of the given number
Syntax: Hex(x)
Example                      Output
Hex(3)                         3
Hex(10)                                   A
13.Exp(x)-Returns the exponent of the number
Syntax: Exp(x)
Example                      Output
Exp(6.7)                       812.405






















No comments:

Post a Comment