docs.unity.cn
    Show / Hide Table of Contents

    Method modf

    modf(Single, out Single)

    Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.

    Declaration
    public static float modf(float x, out float i)
    Parameters
    Type Name Description
    Single x

    Value to split into integral and fractional part.

    Single i

    Output value containing integral part of x.

    Returns
    Type Description
    Single

    The fractional part of x.

    modf(float2, out float2)

    Performs a componentwise split of a float2 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static float2 modf(float2 x, out float2 i)
    Parameters
    Type Name Description
    float2 x

    Value to split into integral and fractional part.

    float2 i

    Output value containing integral part of x.

    Returns
    Type Description
    float2

    The componentwise fractional part of x.

    modf(float3, out float3)

    Performs a componentwise split of a float3 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static float3 modf(float3 x, out float3 i)
    Parameters
    Type Name Description
    float3 x

    Value to split into integral and fractional part.

    float3 i

    Output value containing integral part of x.

    Returns
    Type Description
    float3

    The componentwise fractional part of x.

    modf(float4, out float4)

    Performs a componentwise split of a float4 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static float4 modf(float4 x, out float4 i)
    Parameters
    Type Name Description
    float4 x

    Value to split into integral and fractional part.

    float4 i

    Output value containing integral part of x.

    Returns
    Type Description
    float4

    The componentwise fractional part of x.

    modf(Double, out Double)

    Splits a double value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.

    Declaration
    public static double modf(double x, out double i)
    Parameters
    Type Name Description
    Double x

    Value to split into integral and fractional part.

    Double i

    Output value containing integral part of x.

    Returns
    Type Description
    Double

    The fractional part of x.

    modf(double2, out double2)

    Performs a componentwise split of a double2 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static double2 modf(double2 x, out double2 i)
    Parameters
    Type Name Description
    double2 x

    Value to split into integral and fractional part.

    double2 i

    Output value containing integral part of x.

    Returns
    Type Description
    double2

    The componentwise fractional part of x.

    modf(double3, out double3)

    Performs a componentwise split of a double3 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static double3 modf(double3 x, out double3 i)
    Parameters
    Type Name Description
    double3 x

    Value to split into integral and fractional part.

    double3 i

    Output value containing integral part of x.

    Returns
    Type Description
    double3

    The componentwise fractional part of x.

    modf(double4, out double4)

    Performs a componentwise split of a double4 vector into an integral part i and a fractional part that gets returned. Both parts take the sign of the corresponding input component.

    Declaration
    public static double4 modf(double4 x, out double4 i)
    Parameters
    Type Name Description
    double4 x

    Value to split into integral and fractional part.

    double4 i

    Output value containing integral part of x.

    Returns
    Type Description
    double4

    The componentwise fractional part of x.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023