rng.percent(-10) always return true
Posted: Mon Jan 24, 2011 3:42 am
As written in the title: calling rng.percent() with a negative parameter always return true.
This is a little counterintuitive, as I expected that it would always return false for a negative parameter, and always true for a parameter higher than 100. And looking at the source code (core_lua.c line 1473), I have no idea why it is not the case.
This is a little counterintuitive, as I expected that it would always return false for a negative parameter, and always true for a parameter higher than 100. And looking at the source code (core_lua.c line 1473), I have no idea why it is not the case.