docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method Approximately

    Approximately(float, float)

    A faster replacement for Approximately(float, float).

    Declaration
    public static bool Approximately(float a, float b)
    Parameters
    Type Name Description
    float a

    The first float to compare.

    float b

    The second float to compare.

    Returns
    Type Description
    bool

    true if the values are similar. Otherwise, false.

    Remarks

    Compares two floating point values and returns true if they are similar. As an optimization, this method does not take into account the magnitude of the values it is comparing. This method may not provide the same results as Mathf.Approximately for extremely large values.

    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)