• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Jutho / WignerSymbols.jl / 51
88%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2019 11:22PM UTC
Jobs 4
Files 3
Run time 57min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
51

push

travis-ci

Jutho
Make convert(Real, ::HalfInteger) yield HalfInteger (#5)

As HalfInteger <: Real, there should be no reason to convert anything in
this situation. It happens because the convert method resorts to Float64
as an intermediate value.

To still get conversion to floats, we can just dispatch on AbstractFloat
instead. However, it should be better to convert the numerator to T
first and then divide, so that we would not use a potentially lower
precision intermediate value.

This solves the problem where calling sum on an vector of HalfIntegers
yields a floating point value, even though there is no reason to convert
in the summation:

julia> sum([HalfInteger(1//2), HalfInteger(3//2)])
2.0

This is because there is an implicit convert(::Real) in the Base.add_sum
function. With this patch the sum call correctly yields a HalfInteger.

It also updates the tests related to HalfInteger convert methods:

 - Make sure that the convert tests also check types
 - Add a few tests for converting out of HalfInteger

1 of 1 new or added line in 1 file covered. (100.0%)

308 of 361 relevant lines covered (85.32%)

66095299.46 hits per line

Jobs
ID Job ID Ran Files Coverage
5 51.5 20 Feb 2019 11:22PM UTC 0
77.01
Travis Job 51.5
6 51.6 20 Feb 2019 11:29PM UTC 0
85.44
Travis Job 51.6
7 51.7 20 Feb 2019 11:26PM UTC 0
84.34
Travis Job 51.7
8 51.8 20 Feb 2019 11:31PM UTC 0
84.34
Travis Job 51.8
Source Files on build 51
  • Tree
  • List 0
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #51
  • 6ddbd340 on github
  • Prev Build on master (#48)
  • Next Build on master (#59)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc