Skip to content

Commit 00a9989

Browse files
committed
Merge pull request #28 from yuyichao/0.4-binding
Union() -> Union{}
2 parents ee0ad88 + a39c659 commit 00a9989

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

.travis.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
language: cpp
2-
compiler:
3-
- clang
1+
language: julia
2+
os:
3+
- linux
4+
- osx
5+
julia:
6+
- 0.3
7+
- 0.4
8+
- nightly
49
notifications:
510
email: false
6-
env:
7-
matrix:
8-
- JULIAVERSION="juliareleases"
9-
- JULIAVERSION="julianightlies"
10-
before_install:
11-
- sudo add-apt-repository ppa:staticfloat/julia-deps -y
12-
- sudo add-apt-repository ppa:staticfloat/${JULIAVERSION} -y
13-
- sudo apt-get update -qq -y
14-
- sudo apt-get install libpcre3-dev julia -y
15-
script:
16-
- julia -e 'Pkg.init(); run(`ln -s $(pwd()) $(Pkg.dir("FixedPointNumbers"))`); Pkg.pin("FixedPointNumbers"); Pkg.resolve()'
17-
- julia test/runtests.jl

src/FixedPointNumbers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ end
5757
# Particularly useful for arrays.
5858
scaledual(Tdual::Type, x) = one(Tdual), x
5959
scaledual{Tdual<:Number}(b::Tdual, x) = b, x
60-
scaledual{T<:FixedPoint}(Tdual::Type, x::Union(T, AbstractArray{T})) =
60+
@compat scaledual{T<:FixedPoint}(Tdual::Type, x::Union{T,AbstractArray{T}}) =
6161
convert(Tdual, 1/one(T)), reinterpret(rawtype(T), x)
62-
scaledual{Tdual<:Number, T<:FixedPoint}(b::Tdual, x::Union(T, AbstractArray{T})) =
62+
@compat scaledual{Tdual<:Number, T<:FixedPoint}(b::Tdual, x::Union{T,AbstractArray{T}}) =
6363
convert(Tdual, b/one(T)), reinterpret(rawtype(T), x)
6464

6565
end # module

test/fixed32.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function test_fixed{T}(::Type{T}, f)
66
tol = 2.0^-f
77

88
for x in values
9-
#isinteger(x) && @show x
9+
isinteger(x) && @show x
1010
fx = convert(T,x)
1111
@test convert(T,convert(Float64, fx)) == fx
1212
@test convert(T,convert(Float64, -fx)) == -fx
@@ -45,5 +45,7 @@ function test_fixed{T}(::Type{T}, f)
4545
end
4646

4747
for f in [8, 10, 16]
48-
test_fixed(Fixed32{f}, f)
48+
T = Fixed32{f}
49+
println(" Testing $T")
50+
test_fixed(T, f)
4951
end

test/runtests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
include("fixed32.jl")
2-
include("ufixed.jl")
1+
for f in ["ufixed.jl", "fixed32.jl"]
2+
println("Testing $f")
3+
include(f)
4+
end

0 commit comments

Comments
 (0)