using the git branch remotes/origin/1.1.x
i.e.
user=> (/ 1 -1/2)
-2/1
user=> (/ 1 1/2)
2

I asked about this on IRC and was assured that this was the desired
behaviour. However after thinking about it I could not really
understand what advantage you get by keeping this as a ratio which is
not present in the positive case, so i did some digging, and found why
it happens.

@ line 296 in Numbers.java it checks to see if the denominator is 1,
and if so just returns the numerator. Is it really too much work to
also check if the denominator is -1 thus allowing you to simply return
the negative of the numerator?

Here is the patch I wrote which fixes this problem: 
http://gist.github.com/312146
Of course there may be a better solution, but i'll leave this up to
the people who know what they're doing :)

if you think this is not worth changing, can you suggest a way to
avoid these types of problem? the only thing i can think of is to
multiply every value i have by 1 (which removes the lingering
denominator) before displaying the result to the user. sure i could
just leave things like this, since the values are technically correct,
but when a user sees values like 0/1 they might question what the hell
is going on (just like i did!).

cheers
.Tristan

-- 
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