Sign Method (Double)
Collapse the table of content
Expand the table of content

Math.Sign Method (Double)


Returns an integer that indicates the sign of a double-precision floating-point number.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member Sign : 
        value:float -> int


Type: System.Double

A signed number.

Return Value

Type: System.Int32

A number that indicates the sign of value, as shown in the following table.

Return value



value is less than zero.


value is equal to zero.


value is greater than zero.

Exception Condition

value is equal to NaN.

The following example demonstrates how to use the Sign(Double) method to determine the sign of a Double value and display it to the console.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2016 Microsoft