MCPcopy Create free account
hub / github.com/DFHack/dfhack / int_round

Function int_round

plugins/siege-engine.cpp:257–264  ·  view source on GitHub ↗

round() is only available in C++11

Source from the content-addressed store, hash-verified

255
256// round() is only available in C++11
257static int int_round (double val)
258{
259 double frac = val - floor(val);
260 if (frac < 0.5)
261 return (int)floor(val);
262 else
263 return (int)ceil(val);
264}
265
266static const int WEAR_TICKS = 806400;
267

Callers 1

aimAtPointMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected