FMath::TruncateToHalfIfClose

Truncates a floating point number to half if closer than the given tolerance.

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 double TruncateToHalfIfClose
(
    double F,
    double Tolerance
)

Remarks

Truncates a floating point number to half if closer than the given tolerance.

Returns

The truncated value

Parameters

Parameter

Description

Value

Floating point number to truncate

Tolerance

Maximum allowed difference to 0.5 in order to truncate

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