How to round 1.653782960785311e14 to 1.65e14?


`julia> a

julia> round(a,2)
how to round 1.653782960785311e14 to 1.66e14 ?



That reads as “sign if” to me.


Thanks, For all array not works , is something for array ?

ERROR: MethodError: no method matching signif(::Array{Float64,1}, ::Int64)
Closest candidates are:
signif(::Real, ::Integer) at floatfuncs.jl:136
signif(::Real, ::Integer, ::Integer) at floatfuncs.jl:136
W dniu 2018-03-27 o 21:56, Simon Byrne pisze:


try signif.(rand(5),3))
which will boadcast the operation


Same here :wink: so much for terse function names…



Can someone translate how I should read it correctly? Why it isn’t round?


I guess we pronounce it as signif-icant.

help?> signif
search: signif significand signbit

  signif(x, digits, [base])

  Rounds (in the sense of round) x so that there are digits significant digits, under a base base representation, default 10.
  E.g., signif(123.456, 2) is 120.0, and signif(357.913, 4, 2) is 352.0.


signif is too short, better is sigdigits [sigdigs if you must])


“signif” is what R calls it, fwiw:


its worth very little to those of us who are pleased to have let go of R :grinning:

(glad you are around, Harlan)


It probably should be a method of round if someone wants to open an issue.