docs.unity.cn
    Show / Hide Table of Contents

    Method mad

    mad(Int32, Int32, Int32)

    Returns the result of a multiply-add operation (a * b + c) on 3 int values.

    Declaration
    public static int mad(int a, int b, int c)
    Parameters
    Type Name Description
    Int32 a

    First value to multiply.

    Int32 b

    Second value to multiply.

    Int32 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    Int32

    The multiply-add of the inputs.

    mad(int2, int2, int2)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int2 vectors.

    Declaration
    public static int2 mad(int2 a, int2 b, int2 c)
    Parameters
    Type Name Description
    int2 a

    First value to multiply.

    int2 b

    Second value to multiply.

    int2 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    int2

    The componentwise multiply-add of the inputs.

    mad(int3, int3, int3)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int3 vectors.

    Declaration
    public static int3 mad(int3 a, int3 b, int3 c)
    Parameters
    Type Name Description
    int3 a

    First value to multiply.

    int3 b

    Second value to multiply.

    int3 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    int3

    The componentwise multiply-add of the inputs.

    mad(int4, int4, int4)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int4 vectors.

    Declaration
    public static int4 mad(int4 a, int4 b, int4 c)
    Parameters
    Type Name Description
    int4 a

    First value to multiply.

    int4 b

    Second value to multiply.

    int4 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    int4

    The componentwise multiply-add of the inputs.

    mad(UInt32, UInt32, UInt32)

    Returns the result of a multiply-add operation (a * b + c) on 3 uint values.

    Declaration
    public static uint mad(uint a, uint b, uint c)
    Parameters
    Type Name Description
    UInt32 a

    First value to multiply.

    UInt32 b

    Second value to multiply.

    UInt32 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    UInt32

    The multiply-add of the inputs.

    mad(uint2, uint2, uint2)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint2 vectors.

    Declaration
    public static uint2 mad(uint2 a, uint2 b, uint2 c)
    Parameters
    Type Name Description
    uint2 a

    First value to multiply.

    uint2 b

    Second value to multiply.

    uint2 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    uint2

    The componentwise multiply-add of the inputs.

    mad(uint3, uint3, uint3)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint3 vectors.

    Declaration
    public static uint3 mad(uint3 a, uint3 b, uint3 c)
    Parameters
    Type Name Description
    uint3 a

    First value to multiply.

    uint3 b

    Second value to multiply.

    uint3 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    uint3

    The componentwise multiply-add of the inputs.

    mad(uint4, uint4, uint4)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint4 vectors.

    Declaration
    public static uint4 mad(uint4 a, uint4 b, uint4 c)
    Parameters
    Type Name Description
    uint4 a

    First value to multiply.

    uint4 b

    Second value to multiply.

    uint4 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    uint4

    The componentwise multiply-add of the inputs.

    mad(Int64, Int64, Int64)

    Returns the result of a multiply-add operation (a * b + c) on 3 long values.

    Declaration
    public static long mad(long a, long b, long c)
    Parameters
    Type Name Description
    Int64 a

    First value to multiply.

    Int64 b

    Second value to multiply.

    Int64 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    Int64

    The multiply-add of the inputs.

    mad(UInt64, UInt64, UInt64)

    Returns the result of a multiply-add operation (a * b + c) on 3 ulong values.

    Declaration
    public static ulong mad(ulong a, ulong b, ulong c)
    Parameters
    Type Name Description
    UInt64 a

    First value to multiply.

    UInt64 b

    Second value to multiply.

    UInt64 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    UInt64

    The multiply-add of the inputs.

    mad(Single, Single, Single)

    Returns the result of a multiply-add operation (a * b + c) on 3 float values.

    Declaration
    public static float mad(float a, float b, float c)
    Parameters
    Type Name Description
    Single a

    First value to multiply.

    Single b

    Second value to multiply.

    Single c

    Third value to add to the product of a and b.

    Returns
    Type Description
    Single

    The multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(float2, float2, float2)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float2 vectors.

    Declaration
    public static float2 mad(float2 a, float2 b, float2 c)
    Parameters
    Type Name Description
    float2 a

    First value to multiply.

    float2 b

    Second value to multiply.

    float2 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    float2

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(float3, float3, float3)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float3 vectors.

    Declaration
    public static float3 mad(float3 a, float3 b, float3 c)
    Parameters
    Type Name Description
    float3 a

    First value to multiply.

    float3 b

    Second value to multiply.

    float3 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    float3

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(float4, float4, float4)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float4 vectors.

    Declaration
    public static float4 mad(float4 a, float4 b, float4 c)
    Parameters
    Type Name Description
    float4 a

    First value to multiply.

    float4 b

    Second value to multiply.

    float4 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    float4

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(Double, Double, Double)

    Returns the result of a multiply-add operation (a * b + c) on 3 double values.

    Declaration
    public static double mad(double a, double b, double c)
    Parameters
    Type Name Description
    Double a

    First value to multiply.

    Double b

    Second value to multiply.

    Double c

    Third value to add to the product of a and b.

    Returns
    Type Description
    Double

    The multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(double2, double2, double2)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double2 vectors.

    Declaration
    public static double2 mad(double2 a, double2 b, double2 c)
    Parameters
    Type Name Description
    double2 a

    First value to multiply.

    double2 b

    Second value to multiply.

    double2 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    double2

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(double3, double3, double3)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double3 vectors.

    Declaration
    public static double3 mad(double3 a, double3 b, double3 c)
    Parameters
    Type Name Description
    double3 a

    First value to multiply.

    double3 b

    Second value to multiply.

    double3 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    double3

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    mad(double4, double4, double4)

    Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double4 vectors.

    Declaration
    public static double4 mad(double4 a, double4 b, double4 c)
    Parameters
    Type Name Description
    double4 a

    First value to multiply.

    double4 b

    Second value to multiply.

    double4 c

    Third value to add to the product of a and b.

    Returns
    Type Description
    double4

    The componentwise multiply-add of the inputs.

    Remarks

    When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when this computation is not fused.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, March 29, 2022
    Terms of use