MathSgn
Posted by Mohammad Rahhal, Last modified by Laith Ghawi on 03 July 2019 04:52 PM

Syntax

Public Function MathSgn(Number As Variant) As Variant

Description

This function used to return the sign of the given number.

Parameters

Key Description 
Number numeric value to know the sign for it if positive or negative,value of type Variant.

Return value

Returns a variant value indicating the sign of the specified numeric expression.

Parameter Result: Sgn(Parameter)
1

1

533

1

-1

-1

-533

-1

0

0

true

-1

false

0

"string"

Error : Type Mismatch.

unknown

0 : uninitialized variable.

Null

Error : Invalid use of null.

1/0 Error : division by zero.

Sample

Public Sub main()

AlertMessage (MathSgn(1)) ' Sgn (1) = 1 . the Alert Message will return 1

AlertMessage (MathSgn(true)) ' Sgn (true) = -1 . the Alert Message will return -1

AlertMessage (MathSgn(false)) ' Sgn (false) = 0 . the Alert Message will return 0

End Sub

See Also


Back to VTL Client Script Index

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions