| I agree with Istvan about this.
Regards,
Mike
-----Original Message-----
>From: Istvan Varga
>Sent: Jan 23, 2006 3:42 PM
>To: csound-devel@lists.sourceforge.net
>Subject: Re: [Cs-dev] function tables power-of-2, etc
>
>On Monday 23 January 2006 20:20, Matt Ingalls wrote:
>
>> is that really true? when i looked into this [ about 5 years ago! ]
>> all i found was some bit-wise operations on index increments for
>> oscillators and stuff -- it would be no big deal to replace the bit-wise
>> stuff with a modulo or if statement?
>
>Simply replacing a & with a % is not enough, as the latter cannot
>deal with negative numbers correctly, so you need an additional
>if statement to fix that. Also, a % is much slower than a &.
>An if statement is again not enough, as you need at least two to
>wrap negative numbers, and more to deal with the possibility of
>a very large index.
>In any case, using the & operator is the simplest and fastest
>way to wrap any integer value to a 0..N-1 range, as long as
>N is an integer power of two.
>Additionally, more changes are needed to clean up any tricky code
>that assumes in some (often non-obvious) way a power of two or at
>least even table size. There are many possibilities for introducing
>bugs, something that is best avoided when a release is just about
>to be made.
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>for problems? Stop! Download the new AJAX search engine that makes
>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |