[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] Re: frac semantic



On 12/21/2009 11:47 AM, Julian Rohrhuber wrote:
>> The lang version of .frac is equivalent to n%1. In terms of 
>> usefulness, then, it might be better to go with the ugen definition 
>> of .frac, so both possibilities are covered.
> 
> 
> The lang version currently is the same as the ugen version:
> 
> 
> 
> -1.2.frac // -0.2
> 1.2.frac // 0.2
> { DC.ar(-1.2).frac.poll }.play; // -0.2
> { DC.ar(1.2).frac.poll }.play; // 0.2

you may want to check the sources. the ugen implements arg - floor(arg),
the language as arg - trunc(arg). the trunc implementation relies on a
specific rounding mode ... since it is not set, the trunc implementation
doesn't necessarily behave as it should.

>> yes, i would also prefer this behavior ... if no one objects, i will
>> commit a patch, changing the sclang semantic of frac to match the unit
>> generator ...
> 
> so what of the above behavior is changed by your patch?

arg - floor(arg), as described earlier in this thread

tim

-- 
tim@xxxxxxxxxx
http://tim.klingt.org

Happiness is a byproduct of function, purpose, and conflict; those who
seek happiness for itself seek victory without war.
  William S. Burroughs

Attachment: signature.asc
Description: OpenPGP digital signature