Show / Hide Table of Contents

    Method sgn

    val sgn: 'T -> 'T

    Sign of value returned using same type as input.

    Declaration
    [<CompiledName("Sgn")>]
    val sgn: x:'T -> 'T
    Parameters
    Type Name Description
    'T x

    Input value.

    Returns
    Type Description
    'T

    If x<0, then -1. If x=0, then 0. If x>0, then 1.

    Type Parameters
    Name Description
    'T

    Type of input and output values.

    Remarks

    In contrast, the F# builtin function sign returns an int regardless of the input data type.

    This calls static method Sgn on non-primitive types.

    Back to top Generated by DocFX