RealDocs

UKismetMathLibrary::FMod64

function Engine Blueprint Since 5.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPureUFUNCTION

Description

Int64 version of FMod. Divides Dividend by Divisor and returns the integer quotient as int64 with the fractional remainder as an output.

Caveats & Gotchas

  • Blueprint exposes this as 'Division (Whole and Remainder) to Integer64'. Prefer this over FMod any time the quotient could exceed 2 billion.
  • Like FMod, division by zero silently returns 0 with Remainder set to 0.0. Always validate Divisor in caller code when input is runtime-controlled.

Signature

static ENGINE_API int64 FMod64(double Dividend, double Divisor, double& Remainder);

Parameters

Name Type Description Default
Dividend double The value to be divided.
Divisor double The value to divide by.
Remainder double& Output: the floating-point remainder after integer division.

Return Type

int64

Example

Decompose a large tick count into minutes and remaining ticks C++
double TotalTicks = 9000000060.0;
double RemTicks = 0.0;
int64 Minutes = UKismetMathLibrary::FMod64(TotalTicks, 60.0 * 60.0, RemTicks);
// Minutes == 2500000, RemTicks == 60.0

Tags

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.