News for hackers. Stuff that matters.
Re:Try Julia by rebo on Sunday January 26, 2014 @04:28PM (#7127023)
Is round(x) broken?

    Julia's standard library includes a host of mathematical functions, in addition to the standard operators. Complex numbers are also supported, using the built-in im unit:

    round(pi) 
    lcm(54, 392, 232) # least common multiple 
    sqrt(square(100)) 
    e^(pi * im) 
    log(e ^ 2) + log10(100)

    When you're ready, type "next" to continue
    julia> round(pi)
    no method round(MathConst{:π},)
Re:Try Julia by KenoFischer on Sunday January 26, 2014 @05:43PM (#7127391)
To give some context, several common math constants are use the MathConst type to provide multi-precision constants. This allows e.g. a*pi to be extremely accurate if a is, e.g. a BigInt.

This issue was also reported at https://github.com/JuliaLang/julia/issues/5561

Re:Try Julia by Debilski on Sunday January 26, 2014 @05:01PM (#7127185)
round(x) only works for a few specialised types of x. help(round) tells you that it will return the same type then. Of course for a type of MathConst{:π}, that won’t work. For generic types, you need to at least specify the number of digits (round(pi, 3)). (See also: methods(round))
Re:Try Julia by glomph on Sunday January 26, 2014 @05:12PM (#7127233)
Weird that they have round(pi) as an example.
Re:Try Julia by pygy_ on Sunday January 26, 2014 @07:28PM (#7127891)
It may have worked at some point. The language evolves pretty quickly at the moment.