Clojure

(/ 1 3) returns Ratio 31/3

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not Reproducible
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    openSuSE 13.1

Description

(/ 1 3) incorrectly returns the Ratio 31/3. Other numbers, such as (/ 1 4), work as expected. This could be worked around by using Java interop, but I don't think / it is functioning correctly in this case.

Activity

Hide
Justin Hanekom added a comment -

$ lein version
Leiningen 2.3.4 on Java 1.7.0_51 OpenJDK 64-Bit Server VM

Show
Justin Hanekom added a comment - $ lein version Leiningen 2.3.4 on Java 1.7.0_51 OpenJDK 64-Bit Server VM
Hide
Nicola Mometto added a comment -

I cannot reproduce this on clojure 1.5.1 or 1.6.0-master-SNAPSHOT

Show
Nicola Mometto added a comment - I cannot reproduce this on clojure 1.5.1 or 1.6.0-master-SNAPSHOT
Hide
Alex Miller added a comment -

I also could not reproduce on 1.5 or 1.6. Please provide more information on your Clojure environment ({\*clojure-version\*} and also verify that you're not seeing printing obscuring your repl output or something.

user=> *clojure-version*
{:major 1, :minor 5, :incremental 1, :qualifier nil}
user=> (def x (/ 1 3))
#'user/x
user=> (numerator x)
1
user=> (denominator x)
3
user=> x
1/3
Show
Alex Miller added a comment - I also could not reproduce on 1.5 or 1.6. Please provide more information on your Clojure environment ({\*clojure-version\*} and also verify that you're not seeing printing obscuring your repl output or something.
user=> *clojure-version*
{:major 1, :minor 5, :incremental 1, :qualifier nil}
user=> (def x (/ 1 3))
#'user/x
user=> (numerator x)
1
user=> (denominator x)
3
user=> x
1/3
Hide
Justin Hanekom added a comment -

Today I'm unable to reproduce this behavior, although yesterday I could!? I'm so embarrassed :-*>

Thanks for closing.

Show
Justin Hanekom added a comment - Today I'm unable to reproduce this behavior, although yesterday I could!? I'm so embarrassed :-*> Thanks for closing.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: