News for hackers. Stuff that matters.
Re:A little thing to love about Perl 6 and COBOL by Derbasti on Thursday February 05, 2015 @05:09AM (#9002489)
Another language that supports this is Julia: In Julia, `/` is division, but `//` creates a rational number. Thus, in Julia, `1//10 + 2//10 - 3//10 == 0//1`, and `1 / (1//10 + 2//10 - 3//10) == 1//0`, where `isinf(1//0) == true` and `0//1 == 0`.

But the best thing is that because of Julia's type system, every subsequent operation on rationals will happen rationally as well, including (fast) linear algebra. Obviously this excludes things like `sqrt` or `fft`.

(http://docs.julialang.org/en/release-0.3/manual/complex-and-...)

Re:A little thing to love about Perl 6 and COBOL by cnvogel on Thursday February 05, 2015 @11:33AM (#9004093)
> Another language that supports this is Julia:

As does, for example, scheme (tests done in racket).

    > (- (+ (/ 1 10) (/ 2 10)) (/ 3 10))
    0
    > (= (- (+ (/ 1 10) (/ 2 10)) (/ 3 10)) 0)
    #t