Re: [cc65] Possible bug in cc65

From: thefox xofeht <thefox1aspekt.fi>
Date: 2012-03-26 20:12:04
On Mon, Mar 26, 2012 at 7:45 PM, Johan Kotlinski <kotlinski@gmail.com> wrote:
> About rand being too regular... I am not looking at the implementation
> now, but I would assume it is a linear congruential generator. In that
> case, you will get better results by taking the most significant bit.
> I.e. rand() & 0x8000u instead of rand() & 1...

I didn't look at the code either, but my money's on LFSR (linear
congruential would need a multiplication).

In case it's not an LFSR, you can find alternative implementations
here: http://codebase64.org/doku.php?id=base:6502_6510_maths#random_numbers

-thefox
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Mar 26 20:12:23 2012

This archive was generated by hypermail 2.1.8 : 2012-03-26 20:12:26 CEST