|
|
Am 14.09.2018 um 01:30 schrieb Bald Eagle:
> So I have an array of vectors with .y and .z values ranging from 0 to tau, or
> 2*pi, or whatever the #version's parser allows...
>
> And I just want to see "where" in that range I am....
>
>
>
> #local Mult = 1000;
>
> #local _Patch = array [6];
>
> #for (U, 0, Usize)
> #debug concat ("Testing Y = ", Scalar (YVal, 3, 0), " vs ", Vector
> (UArray [U], 3, 0), " \n")
>
> (commmence anti-floating point calisthenics...)
>
> #if ( int(YVal*Mult) >= int(UArray [U].y*Mult) & int(YVal*Mult) <=
> int(UArray [U].z*Mult) )
>
> #local _Patch [0] = UArray [U].x;
> #local _Patch [1] = UArray [U].y;
> #local _Patch [2] = UArray [U].z;
> #end
> #end
>
> And I mean, it's ZERO, so what do I multiply by and round it with?
> Is f'ing _***INT***_ (0) not ZERO?!
...
> Apparently #for (N, 0, ....
> doesn't give me a zero that's equal to 0 * N2....
Wait.
What you're multiplying is YVal, not U.
What you're debug-outputting is YVal rounded to 0 decimals, not YVal
(nor U, for that matter).
And yes, that Random ASCII article is precise to the last digit:
Floating point arithmetics comes with 16 serious issues - and counting.
Post a reply to this message
|
|