Mono Class Library: System.Math Overview | MembersSystem.Math.Sign Method |
Returns a value indicating the sign of the specified double. [Edit]
|
A int indicating the sign of value.
[The 'table' type of list has not been implemented in the ECMA stylesheet.] [Edit]
Type Reason ArithmeticException value is equal to double.NaN. [Edit]
Documentation for this section has not yet been entered. [Edit]
The following example demonstrates using the Math.Sign(sbyte)(double) method.
C# Example using System; public class MathSignExample { public static void Main() { Double d1 = Math.Sign(4.4); Double d2 = Math.Sign(0.0); Double d3 = Math.Sign(-4.5); Console.WriteLine("Math.Sign(4.4) returns {0}", d1); Console.WriteLine("Math.Sign(0.0) returns {0}", d2); Console.WriteLine("Math.Sign(-4.5) returns {0}", d3); } }The output is
Math.Sign(4.4) returns 1
Math.Sign(0.0) returns 0
Math.Sign(-4.5) returns -1
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0