Click or drag to resize
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
)

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);
See Also