indicates that among several possibilities, one is recommended as particularly suitable, without mentioning or excluding others; or that a certain course of action is preferred but not necessarily required; or that (in the negative form) a certain course of action is deprecated but not prohibited (“should” means “is recommended to”).
This prints 1.0 because LLVM apparently performs constant folding with round to nearest during compilation, but if you paste the method body at the REPL, it gets interpreted, so it prints 1.0000000000000002. Does this bother anyone else?
begin
set_rounding(Float64, RoundUp)
println(1.0+5.0e-324)
set_rounding(Float64, RoundNearest)
nothing
end
begin
for i = 1:1; end
set_rounding(Float64, RoundUp)
println(1.0+5.0e-324)
set_rounding(Float64, RoundNearest)
nothing
end
On Saturday, October 4, 2014 7:49:13 AM UTC-4, Patrick O'Leary wrote:On Wednesday, October 1, 2014 7:01:44 PM UTC-5, Simon Kornblith wrote:This prints 1.0 because LLVM apparently performs constant folding with round to nearest during compilation, but if you paste the method body at the REPL, it gets interpreted, so it prints 1.0000000000000002. Does this bother anyone else?
Julia code is never interpreted--there is no interpreter. This is a function, so global scope issues shouldn't be a problem. Do different optimization passes run for code entered at the REPL?
There is an interpreter that is sometimes used for top-level code, but can't handle some language constructs like loops.