07-19-2011, 02:56 PM
Darkstar Wrote:"Note: CAST(Uinteger, RND) is *always* 0, because RND returns a float number form 0 to 0.99999999..."It is, and very easy indeed, since the main RAND routine generates a 32bits (DE, HL) integer. I can add a library <rand.bas> which contains a randint() routine, for example (it's just a simple call to RAND routine).
I was waiting for that argument somehow. However can you not do a RND that works on integers. I know it can be done
Try this:
Code:
function fastcall randint as ULong
asm
jp RAND
end asm
end function
#require "random.asm"