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

Parameters

value
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

Meaning

-1

value is less than zero.

0

value is equal to zero.

1

value is greater than zero.

Exception Condition
ArithmeticException

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
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft