The question is implied. I seem to remember running into this once before and I can't remember if, or how, I got around it - mine will only act like integers. Any ideas?
You can convert the float to its underlying 32 bit representation and vice versa. In python this is done via the struct module (struct.pack and unpack).
Oh, and of course you can always use it like a fixed point number, e.g. multiply by 1000 and round it for storing, then the other way around for retrieving.
Gah! Too much effort! Yeah I'm doing that, thanks. I have a vague memory that I came up with some cunning fix last time I realised vars were integers (many moons ago), but I probably hallucinated it.
Follow up question: @Sitra Achara , I ran some simulations where I was generating random numbers between 0 and 36 (no prizes for guessing why) - hundreds of thousands of times - and I get zero coming up on average twice as often as I should: even as everything else sort of 'evens out' due to the large sample size. Is there anything about the Mersene that might bias outcomes that way, do you know?
Never nmind, I was massively underestimating how many throws I was actually doing (not a relevant number for final outcome). When I added a counter for this, it turns out zero came up every 36.98 times - pretty spot on.