Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


modf

Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.
Read time 3 minutesLast updated 5 days ago

Definition

modf(float, float)

Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input.
public static float modf(float x, out float i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

floatThe fractional part of x.

modf(float2, 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.
public static float2 modf(float2 x, out float2 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

float2The componentwise fractional part of x.

modf(float3, 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.
public static float3 modf(float3 x, out float3 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

float3The componentwise fractional part of x.

modf(float4, 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.
public static float4 modf(float4 x, out float4 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

float4The componentwise fractional part of x.

modf(double, 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.
public static double modf(double x, out double i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

doubleThe fractional part of x.

modf(double2, 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.
public static double2 modf(double2 x, out double2 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

double2The componentwise fractional part of x.

modf(double3, 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.
public static double3 modf(double3 x, out double3 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

double3The componentwise fractional part of x.

modf(double4, 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.
public static double4 modf(double4 x, out double4 i)

Parameters

Value to split into integral and fractional part.

Output value containing integral part of x.

Returns

Type

Description

double4The componentwise fractional part of x.