??? 09/12/07 09:03 Read: times |
#144437 - tell us what is the application Responding to: ???'s previous message |
Radouane Essellak said:
So it suffices to call xtea(&key) to use the cipher as prng. Yes; however, it's upon you to seed (initialize) it properly. Radouane Essellak said:
If I want a float range [0.0,1.0] numbers, what should I do ?
Should I divide by 2^64-1 ? Formally, yes; although depending on the particular format "float" uses, truncation might occur, which might influence the uniformity. But how are you going to accomplish it? There is nothing like 64-bit arithmetics implemented in SDCC. And, it's most probably not necessary, either. You might perhaps give us more details on your application, so that we can give you a few more hints. Meantime, you might want to read some of the FAQs present on this site, maybe starting with http://www.8052.com/faqs.phtml?FAQ=119919 . JW |