study/first_study/Library/PackageCache/com.unity.shadergraph@3686fafd4720/Documentation~/Fraction-Node.md
jh04010421 739d49f1a0 Unity | 2026.01.20
수업 실습 파일
2026-01-20 11:01:57 +09:00

839 B

Fraction node

The Fraction node returns the fractional part of an input, also known as the decimal part. The range is 0 to 1. For example, the fractional part of 3.75 is 0.75.

The Fraction node calculates the result using the following formula:

fractional_part = input - floor(input)

As a result, the node returns a positive value if you input a negative number. For example, the fractional part of -3.75 is 0.25.

Ports

Name Direction Type Description
In Input Dynamic Vector Input value
Out Output Dynamic Vector Output value

Generated Code Example

The following example code represents one possible outcome of this node.

void Unity_Fraction_float4(float4 In, out float4 Out)
{
    Out = frac(In);
}