docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method FModWrap

    FModWrap(float, float)

    FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b).

    Declaration
    public static float FModWrap(float v, float m)
    Parameters
    Type Name Description
    float v

    Quotient

    float m

    Divisor

    Returns
    Type Description
    float

    a % b if a >= 0 but b + a%b other wise

    FModWrap(double, double)

    FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b).

    Declaration
    public static double FModWrap(double v, double m)
    Parameters
    Type Name Description
    double v

    Quotient

    double m

    Divisor

    Returns
    Type Description
    double

    a % b if a >= 0 but b + a%b other wise

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)