[PD] Can $0 be 0?

Miller Puckette mpuckett at imusic1.ucsd.edu
Mon Aug 14 21:16:19 CEST 2006


Oops.

cheers
M

On Sun, Aug 13, 2006 at 10:15:20PM -0400, Mathieu Bouchard wrote:
> On Sun, 13 Aug 2006, Miller Puckette wrote:
> 
> >Anyway, $0 uses true integers, so that it's unlikely they will ever 
> >reach zero (you'd have to fill your address speace 100s of times)... so 
> >I think you're safe.
> 
> Not quite.
> It breaks after 16776217 object creations.
> 16776217 = (1<<24)-1000+1.
> 
> Your "true integer" has a maximum value of (1<<31)-1, because the return 
> value of canvas_getdollarzero is "int".
> 
> But then it gets converted to a 32-bit float (A_FLOAT) by 
> canvas_realizedollar, and the maximum contiguous integer value of 32-bit 
> floats is 1<<24 = 16777216 (if you increment it, it may stick there or 
> increment by 2 instead, because there are no odd numbers beyond that 
> point).
> 
> You don't have to fill your address space even once to get there, if 
> abstraction instances get dynamically created and deleted over a long 
> period of time.
> 
>  _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard - t?l:+1.514.383.3801 - http://artengine.ca/matju
> | Freelance Digital Arts Engineer, Montr?al QC Canada





More information about the Pd-list mailing list