Search Results for

    Show / Hide Table of Contents

    Class IntegerExtensions

    Inheritance
    object
    IntegerExtensions
    Namespace: GGL.Extensions
    Assembly: GGL.dll
    Syntax
    public static class IntegerExtensions

    Methods

    | Edit this page View Source

    Abs(int)

    Returns the absolute value of value.

    Declaration
    public static int Abs(this int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    int
    | Edit this page View Source

    Clamp(int, int)

    Clamp(int, int, int) but min=0

    Declaration
    public static int Clamp(this int value, int max)
    Parameters
    Type Name Description
    int value
    int max
    Returns
    Type Description
    int
    | Edit this page View Source

    Clamp(int, int, int)

    Clamps the given value between a range defined by the given minimum integer and maximum integer values. Returns the given value if it is within min and max.

    Declaration
    public static int Clamp(this int value, int min, int max)
    Parameters
    Type Name Description
    int value

    The integer point value to restrict inside the min-to-max range.

    int min

    The minimum integer point value to compare against.

    int max

    The maximum integer point value to compare against.

    Returns
    Type Description
    int

    The int result between min and max values.

    | Edit this page View Source

    IsWithin(int, int, int)

    Checks if value is within a range [a,b].

    Declaration
    public static bool IsWithin(this int value, int a, int b)
    Parameters
    Type Name Description
    int value
    int a
    int b
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX