Skip to content

Commit 1f268a0

Browse files
committed
Update Compat and use seed instead of srand
1 parent a9fe1c9 commit 1f268a0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.6
2-
Compat 0.62.0
2+
Compat 1.0.1

test/cformat.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
_erfinv(z) = sqrt(π) * Base.Math.@horner(z, 0, 1, 0, π/12, 0, 7π^2/480, 0, 127π^3/40320, 0,
22
4369π^4/5806080, 0, 34807π^5/182476800) / 2
3+
34
function test_equality()
45
println( "test cformat equality...")
5-
srand(10)
6+
Random.seed!(10)
67
fmts = [ (x->@sprintf("%10.4f",x), "%10.4f"),
78
(x->@sprintf("%f", x), "%f"),
89
(x->@sprintf("%e", x), "%e"),
@@ -62,20 +63,20 @@ println( "integer sprintf speed, bypass repeated lookup")
6263
@time runtime_int_bypass()
6364

6465
function native_float()
65-
srand( 10 )
66+
Random.seed!( 10 )
6667
for i in 1:200000
6768
@sprintf( "%10.4f", _erfinv( rand() ) )
6869
end
6970
end
7071
function runtime_float()
71-
srand( 10 )
72+
Random.seed!( 10 )
7273
for i in 1:200000
7374
cfmt( "%10.4f", _erfinv( rand() ) )
7475
end
7576
end
7677
function runtime_float_bypass()
7778
f = generate_formatter( "%10.4f" )
78-
srand( 10 )
79+
Random.seed!( 10 )
7980
for i in 1:200000
8081
f( _erfinv( rand() ) )
8182
end

0 commit comments

Comments
 (0)