Language:
Discover
By Skill Level
By Category

FGenericPlatformMath::Fmod

Choose your OS:

Syntax

static float Fmod
(
    float X,
    float Y
)

Remarks

Returns the floating-point remainder of X / Y Warning: Always returns remainder toward 0, not toward the smaller multiple of Y. So for example Fmod(2.8f, 2) gives .8f as you would expect, however, Fmod(-2.8f, 2) gives -.8f, NOT 1.2f Use Floor instead when snapping positions that can be negative to a grid

References

Module

Core

Header

Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h