[swift-evolution] Proposal: A standard library Fraction type

T.J. Usiyan griotspeak at gmail.com
Sun Dec 20 18:10:04 CST 2015


Calculating precession time of two frequencies is an example. (consider
displaying two waveforms)

On Mon, Dec 7, 2015 at 5:43 PM, T.J. Usiyan <griotspeak at gmail.com> wrote:

> We seem to have become distracted with the whole Time Signature thing.
> Time signatures themselves are not Rationals. I should have said "Metrical
> Time" and left it at that. My point has always been that metrical time
> calls for the use of Rationals.
> TJ
>
> On Mon, Dec 7, 2015 at 9:20 PM, Matthew Johnson <matthew at anandabits.com>
> wrote:
>
>>
>> > If your implementation of Rational simplifies immediately, sure. Mine
>> doesn't and it is useful in many other cases not to as well. You might, for
>> example, want to present the original numerator/denominator provided by the
>> user.
>>
>> How does your implementation implement equality?  From a numeric
>> standpoint I think most people would consider 3/4 to be equal to 6/8
>> whereas this would not be correct for a time signature.
>>
>> In any case, I agree that a rational type would be a useful addition to
>> the library.  I don't think I would use it to model time signatures but
>> there are plenty of other uses.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151220/a29986d7/attachment.html>


More information about the swift-evolution mailing list