Search Results for

    Show / Hide Table of Contents

    Class FloatExtensions

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

    Methods

    | Edit this page View Source

    Abs(float)

    Returns the absolute value of f.

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

    Clamp(float, float)

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

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

    Clamp(float, float, float)

    Clamps the given value between the given minimum float and maximum float values. Returns the given value if it is within the minimum and maximum range.

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

    The floating point value to restrict inside the range defined by the minimum and maximum values.

    float min

    The minimum floating point value to compare against.

    float max

    The maximum floating point value to compare against.

    Returns
    Type Description
    float

    The float result between the minimum and maximum values.

    | Edit this page View Source

    IsWithin(float, float, float)

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

    Declaration
    public static bool IsWithin(this float value, float a, float b)
    Parameters
    Type Name Description
    float value
    float a
    float b
    Returns
    Type Description
    bool
    | Edit this page View Source

    Remap(float, float, float, float, float)

    Remaps a value from a range [a,b] to a range [c,d].

    Declaration
    public static float Remap(this float value, float a, float b, float c, float d)
    Parameters
    Type Name Description
    float value
    float a
    float b
    float c
    float d
    Returns
    Type Description
    float
    | Edit this page View Source

    Round(float)

    Returns f rounded to the nearest integer.

    Declaration
    public static int Round(this float value)
    Parameters
    Type Name Description
    float value
    Returns
    Type Description
    int
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX