FMath::RoundHalfToEven

Converts a floating point number to the nearest integer, equidistant ties go to the value which is closest to an even value: 1.5 becomes 2, 0.5 becomes 0

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Source

/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp

Syntax

static float RoundHalfToEven
(
    float F
)

Remarks

Converts a floating point number to the nearest integer, equidistant ties go to the value which is closest to an even value: 1.5 becomes 2, 0.5 becomes 0

Returns

The rounded integer

Parameters

Parameter

Description

F

Floating point value to convert

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss