Re: different wrap behavior for float/integer
| Newsgroups | gmane.comp.audio.supercollider.user |
|---|---|
| Message-ID | <CAK6yb7ZknGO+CjGs05m36_yoiXgPYFQ=8su=mof3SGurEY36xA@mail.gmail.com> |
Interesting - only when all three numbers are integers are the results different: ( var x = 50; var y = 10; x.asFloat.wrap(0.asFloat, y.asFloat).postln; x.asFloat.wrap(0.asInteger, y.asInteger).postln; x.asInteger.wrap(0.asInteger, y.asInteger).postln; x.asInteger.wrap(0.asFloat, y.asInteger).postln; x.asInteger.wrap(0.asInteger, y.asFloat).postln; x.asInteger.wrap(0.asFloat, y.asFloat).postln; nil; ) 0.0 0.0 6 0.0 0.0 0.0 On Thu, Feb 25, 2021 at 12:40 PM <[email protected]> wrote: > I just noticed something that seems odd, possibly wrong: > > 11.0.wrap(0,10); //returns 1.0 > 11.wrap(0,10); //returns 0 > > Shouldn't these both return 1? It's like the wrapping gets out of sync > between floats/integers. > > 50.0.wrap(0,10); //returns 0.0 > 50.wrap(0,10); //returns 6 > > Or am I misunderstanding conventional wrap behavior? I'm on SC 3.11.2. > > Eli > _________________________ > Eli Fieldsteel, DMA (he/him/his) > Director, University of Illinois Experimental Music Studios > Assistant Professor of Composition-Theory > Office: 217-300-0956 > MB 4008, School of Music > 1114 W Nevada Street > Urbana, IL 61801 >