Login
Try VertexFX
  • Home
  • Knowledgebase
  • Blog
  • Home
  • Knowledgebase
  • Blog

Math Functions

home/Knowledge Base/Technical Support/API/Client API's/VTL/VTL Client Scripts/Math Functions/MathSgn

MathSgn

17 views 0 Updated on December 16, 2021 hybrid-solutions

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 1AlertMessage (MathSgn(true)) ' Sgn (true) = -1 . the Alert Message will return -1AlertMessage (MathSgn(false)) ' Sgn (false) = 0 . the Alert Message will return 0End Sub

See Also

  • MathSqr
  • MathTan
  • MathArcCos


Back to VTL Client Script Index

Was this helpful?

Yes  No
Leave A Comment Cancel reply

  MathSin

MathSqr  

About
VertexFX Trader has a closed-loop trading structure with Backoffice dealing desk, Client Terminals, Dedicated Hosting, White Labelling and Bridging Capabilities. Through VertexFX Risk Management Bridge...
Categories
  • Release Notes
  • Technical Support
  • VertexFX Pro Setup
  • Mobile Trader
  • Lite VertexFX Mobile Trader
Community
  • Blog
  • Media Center
Need Support?
If you need any further help, don't hesitate to send a support request to our support team.
Contact Support
  • Privacy Policy
  • Brokers Terms
  • Traders EULA
  • ISV Terms
  • Plugins EULA
  • Copyright 2023 hybridsolutions.com. All Rights Reserved.