Skip to content

Commit bd60a69

Browse files
authored
Merge pull request #74 from simonbyrne/sb/0.7
update for 0.7
2 parents 628c4cb + bea1b0f commit bd60a69

File tree

5 files changed

+41
-25
lines changed

5 files changed

+41
-25
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ os:
66

77
julia:
88
- 0.6
9+
- 0.7
910
- nightly
1011

1112
notifications:

REQUIRE

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
julia 0.6
22
Compat 0.61.0
33
BinaryProvider
4+
SpecialFunctions

appveyor.yml

+18-21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
3+
- julia_version: 0.6
4+
- julia_version: 0.7
5+
- julia_version: latest
6+
7+
platform:
8+
- x86
9+
- x64
10+
11+
## uncomment the following lines to allow failures on nightly julia
12+
## (tests will run but not make your overall status red)
13+
#matrix:
14+
# allow_failures:
15+
# - julia_version: latest
716

817
branches:
918
only:
@@ -17,24 +26,12 @@ notifications:
1726
on_build_status_changed: false
1827

1928
install:
20-
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
21-
# if there's a newer build queued for the same PR, cancel this one
22-
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
23-
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
24-
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
25-
throw "There are newer queued builds for this pull request, failing early." }
26-
# Download most recent Julia Windows binary
27-
- ps: (new-object net.webclient).DownloadFile(
28-
$env:JULIA_URL,
29-
"C:\projects\julia-binary.exe")
30-
# Run installer silently, output to C:\projects\julia
31-
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
29+
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/master/bin/install.ps1'))
3230

3331
build_script:
34-
# Need to convert from shallow to complete for Pkg.clone to work
35-
- IF EXIST .git\shallow (git fetch --unshallow)
36-
- C:\projects\julia\bin\julia -e "versioninfo();
37-
Pkg.clone(pwd(), \"DecFP\"); Pkg.build(\"DecFP\")"
32+
- echo "%JL_BUILD_SCRIPT%"
33+
- julia -e "%JL_BUILD_SCRIPT%"
3834

3935
test_script:
40-
- C:\projects\julia\bin\julia -e "Pkg.test(\"DecFP\")"
36+
- echo "%JL_TEST_SCRIPT%"
37+
- julia -e "%JL_TEST_SCRIPT%"

src/DecFP.jl

+15-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ using Compat, Compat.Printf, Compat.Unicode
2020
export GC
2121
end
2222

23+
@static if VERSION >= v"0.7.0-alpha.69"
24+
import SpecialFunctions
25+
end
26+
2327
export Dec32, Dec64, Dec128, @d_str, @d32_str, @d64_str, @d128_str, exponent10, ldexp10
2428

2529
# Load libbid from our deps.jl
@@ -368,18 +372,26 @@ for w in (32,64,128)
368372
@eval Base.$f(x::$BID) = ccall(($(bidsym(w,c)), libbid), Cint, ($BID,), x) != 0
369373
end
370374

371-
for (f,c) in ((:+,"add"), (:-,"sub"), (:*,"mul"), (:/, "div"), (:hypot,"hypot"), (:atan2,"atan2"), (:^,"pow"), (:copysign,"copySign"))
375+
for (f,c) in ((:+,"add"), (:-,"sub"), (:*,"mul"), (:/, "div"), (:hypot,"hypot"), (VERSION >= v"0.7.0-alpha.44" ? :atan : :atan2,"atan2"), (:^,"pow"), (:copysign,"copySign"))
372376
@eval Base.$f(x::$BID, y::$BID) = nox(ccall(($(bidsym(w,c)), libbid), $BID, ($BID,$BID), x, y))
373377
end
374378

375-
for f in (:exp,:log,:sin,:cos,:tan,:asin,:acos,:atan,:sinh,:cosh,:tanh,:asinh,:acosh,:atanh,:log1p,:expm1,:log10,:log2,:exp2,:exp10,:lgamma,:sqrt,:cbrt,:abs)
379+
for f in (:exp,:log,:sin,:cos,:tan,:asin,:acos,:atan,:sinh,:cosh,:tanh,:asinh,:acosh,:atanh,:log1p,:expm1,:log10,:log2,:exp2,:exp10,:sqrt,:cbrt,:abs)
376380
@eval Base.$f(x::$BID) = @xchk(ccall(($(bidsym(w,f)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
377381
end
378382

379-
for (f,c) in ((:gamma,"tgamma"), (:-,"negate"), (:trunc,"round_integral_zero"), (:floor,"round_integral_negative"), (:ceil,"round_integral_positive"), (:round,"nearbyint"))
383+
for (f,c) in ((:-,"negate"), (:trunc,"round_integral_zero"), (:floor,"round_integral_negative"), (:ceil,"round_integral_positive"), (:round,"nearbyint"))
380384
@eval Base.$f(x::$BID) = @xchk(ccall(($(bidsym(w,c)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
381385
end
382386

387+
@static if VERSION >= v"0.7.0-alpha.69"
388+
@eval SpecialFunctions.lgamma(x::$BID) = @xchk(ccall(($(bidsym(w,:lgamma)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
389+
@eval SpecialFunctions.gamma(x::$BID) = @xchk(ccall(($(bidsym(w,:tgamma)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
390+
else
391+
@eval Base.lgamma(x::$BID) = @xchk(ccall(($(bidsym(w,:lgamma)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
392+
@eval Base.gamma(x::$BID) = @xchk(ccall(($(bidsym(w,:tgamma)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
393+
end
394+
383395
for (r,c) in ((RoundingMode{:Nearest},"round_integral_nearest_even"), (RoundingMode{:NearestTiesAway},"round_integral_nearest_away"), (RoundingMode{:ToZero},"round_integral_zero"), (RoundingMode{:Up},"round_integral_positive"), (RoundingMode{:Down},"round_integral_negative"))
384396
@eval Base.round(x::$BID, ::$r) = @xchk(ccall(($(bidsym(w,c)), libbid), $BID, ($BID,), x), DomainError, x, mask=INVALID)
385397
end

test/runtests.jl

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ if !(VERSION < v"0.7.0-DEV.1592")
44
using Base.MathConstants
55
end
66

7+
if VERSION >= v"0.7.0-alpha.69"
8+
using SpecialFunctions
9+
end
10+
11+
712
@test unsafe_load(DecFP.flags[]) == 0
813

914
import DecFP.isnanstr
@@ -130,7 +135,7 @@ for T in (Dec32, Dec64, Dec128)
130135
@test f(xd,yd) == f(x,y)
131136
end
132137

133-
for f in (/,hypot,atan2,^)
138+
for f in (/,hypot,atan,^)
134139
@test f(xd,yd) f(x,y)
135140
if f != ^
136141
@test f(yd,xd) f(y,x)

0 commit comments

Comments
 (0)