[PD] countings
Mathieu Bouchard
matju at sympatico.ca
Fri Jul 11 03:07:51 CEST 2003
On Thu, 10 Jul 2003, Tim Blechmann wrote:
> > [mod 360] actually produces numbers between 0 and 359 forever and ever and
> > ever.
> it's true, you get numbers between 0 and 359. but it's possible that
> you reach an overflow ... in these cases it's not continuous...
> well, overflows won't happen that often, but you should be aware of
> this ;-)
> that's why i'd prefer the couter that's reseted when reaching 360...
Overflow will never happen.
It will stop at 16777216.
For, do this:
[16777216(
|
[+ 1]
|
[& 255]
|
[print]
print: 0
This is because 16777215 is the last odd integer available in float32
format.
Note: if you save the patch and reload, the result will be much different:
print: 241
but that's because PD does a little too much rounding while saving the
patch. but with binary<->decimal conversions, it's either too much or too
little: the "number of significant (decimal) digits" is not integer.
________________________________________________________________
Mathieu Bouchard http://artengine.ca/matju
More information about the Pd-list
mailing list