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

Function random_error

plugins/siege-engine.cpp:250–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static double random_error()
251{
252 // Irwin-Hall approximation to normal distribution with n = 3; varies in (-3,3)
253 return (rng.drandom0() + rng.drandom0() + rng.drandom0()) * 2.0 - 3.0;
254}
255
256// round() is only available in C++11
257static int int_round (double val)

Callers 1

aimAtPointMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected