Template talk:Bad guy/compute

Rounding etc

 * The computations here follow the game code. However, as it is based on a custom language/syntax, the semantics of some operations are unclear, and I've just made my best guess on how that works.  Unfortunately, I still sometimes observe an imperfect result (e.g., encountering a Gulch Goblin jeweler with a muscle of 14, as a Snake Oiler).
 * How is rounding done? I've assumed, based on some initial observations and calculations, that division is always integer-based, essentially a floor function rather than rounded (e.g., "11/3" returns = 3).  However, I have not ruled out the possibility that floating point values are used internally, and the flooring is done on the final value rather than at each intermediate computation.
 * How does the "rand" function actually interpret its arguments? Given "rand(a,b)", does it return a number in the range:
 * "[a,b]"? This is what I assumed so far, but it becomes unclear what happens when b<a ... does it then return 0, or a? I've assumed 0, but if it were a then that might match things better.
 * "[a,b-1]"? This would match how most rand functions work, but given that the observed inaccuracies show up in terms of the upper range being too low already, this does not seem possible.
 * "[a,a+b]"? This eliminates the problems with b=1, which is not always true.
 * --Fig bucket (talk) 18:19, 1 September 2017 (UTC)