[chuck-users] Integer divisions

Stefan Blixt stefan.blixt at gmail.com
Tue Dec 15 06:07:33 EST 2009

I don't know... isn't this how most of the curly bracket languages work?
Might as well keep ChucK in line with the other languages. Btw, shouldn't it
be the same as this:

[Interval.r(1), Interval.r(1), Interval.r(1), Interval.r(1)]


On Tue, Dec 15, 2009 at 11:29 AM, Hans Aberg <haberg at math.su.se> wrote:

> I find the integer divisions C rule is problematic when working with
> intervals. Suppose I have [8/7, 7/6, 7/6, 8/7] and implement it as
>  [Interval.r(8/7), Interval.r(7/6), Interval.r(7/6), Interval.r(8/7)]
> Then this is the same as:
>  [Interval.r(0), Interval.r(0), Interval.r(0), Interval.r(0)]
> One has to add ".0" one of the numerator/denominator:
>  [Interval.r(8.0/7), Interval.r(7.0/6), Interval.r(7.0/6),
> Interval.r(8.0/7)],
> One possible rule might be converting 32-bit int to 64-bit floats, and then
> only back to int when needed. The question if it then affects some ChucK
> legacy code.
>  Hans
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Release me, insect, or I will destroy the Cosmos!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091215/121e739c/attachment.html>

More information about the chuck-users mailing list