Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Out of memory when using uinteger array (*solved*)
#15
Darkstar Wrote:"Note: CAST(Uinteger, RND) is *always* 0, because RND returns a float number form 0 to 0.99999999..."

I was waiting for that argument somehow. However can you not do a RND that works on integers. I know it can be done Big Grin
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).

Try this:
Code:
function fastcall randint as ULong
   asm
   jp RAND
   end asm
end function

#require "random.asm"
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)