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

Jutho / WignerSymbols.jl / 51 / 8
88%
master: 88%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2019 11:31PM UTC
Files 3
Run time 34min
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

20 Feb 2019 11:16PM UTC coverage: 84.341% (+7.6%) from 76.731%
51.8

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

307 of 364 relevant lines covered (84.34%)

21176828.85 hits per line

Source Files on job 51.8
  • Tree
  • List 0
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41
  • Travis Job 51.8
  • 6ddbd340 on github
  • Prev Job for on master (#48.2)
  • Next Job for on master (#59.1)
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