MCPcopy Create free account
hub / github.com/beefytech/Beef / roundf

Function roundf

BeefRT/MinRT/MinRT.cpp:458–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458extern "C" __declspec(dllexport) float roundf(float val)
459{
460 if (!_finitef(val))
461 {
462 return val;
463 }
464 else if (val >= 0)
465 {
466 float result = floorf(val);
467 if (result - val <= -0.5f)
468 result += 1.0f;
469 return result;
470 }
471 else
472 {
473 float result = floorf(-val);
474 if (result + val <= -0.5f)
475 result += 1.0f;
476 return -result;
477 }
478}
479
480extern "C" __declspec(dllexport) double round(double val)
481{

Callers 1

RoundMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected