Ratio doesn't emit the numerator and denominator:
http://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Ratio.java

I'm not sure that would help solve your problem, even if it were
available.  You either need to turn the ratio into a non-ratio (using
float or double) or use unchecked math functions which are subject to
truncation (e.g., unchecked-multiply).

On May 30, 1:32 pm, alux <alu...@googlemail.com> wrote:
> Hello,
>
> I careless used rationals in a function, and, well, it took some
> minutes to understand why it was slowing down. (I did this formatting
> by (println (* 1.0 x)) when it started being unreadable - and forgot
> that).
>
> I still see rationals as very nice, but try to use them carefully now.
> What I would really like is a possibility to round to a numer of a
> certain size. Like, to an continued fraction of a certain size. But,
> there I need access to the length of numerator and denominator.
>
> Now the question - is there any way to access this (or to reach to
> goal of rounding to a rational), that is easier than using the
> BigIntegers myself?
>
> Thank you, alux

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to