On Thu, 09 May 2002 01:55:58 +0200, Tor Olav Kristensen
<tor### [at] hotmail com> wrote:
> I just discovered that RC4 for Windows does not issue an
> error message if one tries to access array element nr. -1
>
> Here's the code I tried:
>
> #declare A = array[1] { 0 }
>
> // No error messages
> #declare N = A[-1];
> #declare A[-1] = 0;
I can confirm however I wonder if it could be ... floating point accuracy.
What rounding is performed when float is converted to integer ? Truncation
towards zero ? Could it be that -1 is internally something like -0.99999999999
and after truncation it is valid value 0 ? If yes then possible fix is to
check sign of the float before conversion to int.
POV 3.5 RC4 icl on WinNT Sp 6 PII 233 with 128 MB
ABX
Post a reply to this message
|