[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Re: Re: How many years?
SimpleNumber:asFraction:
0.333.asFraction
returns an array with numerator and denominator
we should have one though (that can handle math, etc.). I'll think about building something like that.
Josh
On Sep 20, 2010, at 10:53 AM, Bernardo Barros wrote:
> Hi,
>
> Is there a (or kind of) Fraction class? (probably there is but I don't remember)
>
>
>
> 2010/9/19 Tim Blechmann <tim@xxxxxxxxxx>:
>>> But the computer doesn't knows that :-/
>>> I can't find a reference or explanation nor can deduce it myself.
>>>
>>> 0.33333333333333 * 3; // 0.99999999999999
>>> 0.33333333333334 * 3; // 1
>>> 0.33333333333335 * 3; // 0.0000000000001
>>> 0.333333333333333 * 3 // 1
>>>
>>> Is this a feature of the floating point representation?
>>> When one is one?
>>
>> well, floating point numbers are not able to represent the number 1/3. [1]
>> may be interesting to read, as it describes some of the problems of using
>> floating-point math.
>>
>> cheers, tim
>>
>> [1] http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
>>
>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-users/
>> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/
******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/
“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/