gmp_lib.mpf_sgn Method

GMP Native Interface for .NET

gmp_libmpf_sgn Method
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static int mpf_sgn(
	mpf_t op
)
Public Shared Function mpf_sgn ( 
	op As mpf_t
) As Integer
public:
static int mpf_sgn(
	mpf_t^ op
)
static member mpf_sgn : 
        op : mpf_t -> int 

Parameters

op
Type: Math.Gmp.Nativempf_t
The operand float.

Return Value

Type: Int32
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.
Examples
// Create, initialize, and set the value of op to -10.
mpf_t op = new mpf_t();
gmp_lib.mpf_init_set_si(op, -10);

// Assert that the sign of op is -1.
Assert.IsTrue(gmp_lib.mpf_sgn(op) == -1);

// Release unmanaged memory allocated for op.
gmp_lib.mpf_clear(op);
' Create, initialize, and set the value of op to -10.
Dim op As New mpf_t()
gmp_lib.mpf_init_set_si(op, -10)

' Assert that the sign of op is -1.
Assert.IsTrue(gmp_lib.mpf_sgn(op) = -1)

' Release unmanaged memory allocated for op.
gmp_lib.mpf_clear(op)

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

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

See Also