Skip to content

Commit 24491ff

Browse files
committed
update Windows, add badges
1 parent 79a32f1 commit 24491ff

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Quadmath.jl
22

3+
[![Travis Build Status](https://travis-ci.org/simonbyrne/Quadmath.jl.svg?branch=master)](https://travis-ci.org/simonbyrne/Quadmath.jl)
4+
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/wx46vbwmu2ey5qkj?svg=true)](https://ci.appveyor.com/project/simonbyrne/quadmath-jl)
5+
36
This is a Julia interface to libquadmath, providing a `Float128` type corresponding to the IEEE754 binary128 floating point format.
47

58
## Installation

src/Quadmath.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ convert(::Type{Float128}, x::Cuint) =
8686
Float128(ccall((:__floatunsitf, libquadmath), Cfloat128, (Cuint,), x))
8787

8888
## Clong (Int64 on unix)
89-
convert(::Type{Clong}, x::Float128) =
90-
ccall((:__fixtfdi, libquadmath), Clong, (Cfloat128,), x)
91-
convert(::Type{Float128}, x::Clong) =
92-
Float128(ccall((:__floatditf, libquadmath), Cfloat128, (Clong,), x))
93-
89+
if !is_windows()
90+
convert(::Type{Clong}, x::Float128) =
91+
ccall((:__fixtfdi, libquadmath), Clong, (Cfloat128,), x)
92+
convert(::Type{Float128}, x::Clong) =
93+
Float128(ccall((:__floatditf, libquadmath), Cfloat128, (Clong,), x))
94+
end
9495

9596

9697
# comparison

test/runtests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using Base.Test
22
using Quadmath
33

4-
@test Float128(1) + Float128(2) == Float128(3)
5-
@test Float128(1) + Float128(2) <= Float128(3)
6-
@test Float128(1) + Float128(2) != Float128(4)
7-
@test Float128(1) + Float128(2) < Float128(4)
8-
@test Float64(Float128(1) + Float128(2)) === 3.0
4+
@test Float128(1.0) + Float128(2.0) == Float128(3.0)
5+
@test Float128(1.0) + Float128(2.0) <= Float128(3.0)
6+
@test Float128(1.0) + Float128(2.0) != Float128(4.0)
7+
@test Float128(1.0) + Float128(2.0) < Float128(4.0)
8+
@test Float64(Float128(1.0) + Float128(2.0)) === 3.0
99

10-
@test Base.exponent_one(Float128) == reinterpret(UInt128, Float128(1))
10+
@test Base.exponent_one(Float128) == reinterpret(UInt128, Float128(1.0))

0 commit comments

Comments
 (0)