Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jan 6, 2015
2 parents 5f20d22 + a318578 commit 78e99a5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end

function start_repl_backend(repl_channel::RemoteRef, response_channel::RemoteRef)
backend = REPLBackend(repl_channel, response_channel, nothing)
@async begin
global interactive_task = @schedule begin
# include looks at this to determine the relative include path
# nothing means cwd
while true
Expand Down
4 changes: 4 additions & 0 deletions base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function task_done_hook(t::Task)
end
yieldto(nexttask, result)
else
if err && isa(result,InterruptException) && isdefined(REPL,:interactive_task) &&
REPL.interactive_task.state == :waiting && isempty(Workqueue)
throwto(REPL.interactive_task, result)
end
wait()
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ typedef struct {

extern DLLEXPORT jl_compileropts_t jl_compileropts;

// Settings for code_coverage and mallog_log
// Settings for code_coverage and malloc_log
#define JL_LOG_NONE 0
#define JL_LOG_USER 1
#define JL_LOG_ALL 2
Expand Down
16 changes: 16 additions & 0 deletions test/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,19 @@

@test isqrt(4) == 2
@test isqrt(5) == 2
# issue #4884
@test isqrt(9223372030926249000) == 3037000498
@test isqrt(typemax(Int128)) == int128("13043817825332782212")
@test isqrt(int128(typemax(Int64))^2-1) == 9223372036854775806
@test isqrt(0) == 0
for i = 1:1000
n = rand(UInt128)
s = isqrt(n)
@test s*s <= n
@test (s+1)*(s+1) > n
n = rand(UInt64)
s = isqrt(n)
@test s*s <= n
@test (s+1)*(s+1) > n
end

16 changes: 0 additions & 16 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,22 +277,6 @@ end
@test any(ccall("jl_zero_subnormals", UInt8, (UInt8,), 1) .== [0x00 0x01])
@test any(ccall("jl_zero_subnormals", UInt8, (UInt8,), 0) .== [0x00 0x01])

# isqrt (issue #4884)
@test isqrt(9223372030926249000) == 3037000498
@test isqrt(typemax(Int128)) == int128("13043817825332782212")
@test isqrt(int128(typemax(Int64))^2-1) == 9223372036854775806
@test isqrt(0) == 0
for i = 1:1000
n = rand(UInt128)
s = isqrt(n)
@test s*s <= n
@test (s+1)*(s+1) > n
n = rand(UInt64)
s = isqrt(n)
@test s*s <= n
@test (s+1)*(s+1) > n
end

# useful test functions for relative error
err(z, x) = abs(z - x) / abs(x)
errc(z, x) = max(err(real(z),real(x)), err(imag(z),imag(x)))
Expand Down

0 comments on commit 78e99a5

Please sign in to comment.