Closed mossheim closed 7 years ago
Merging #115 into master will increase coverage by
0.09%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #115 +/- ##
==========================================
+ Coverage 87.74% 87.83% +0.09%
==========================================
Files 50 50
Lines 1452 1447 -5
==========================================
- Hits 1274 1271 -3
+ Misses 178 176 -2
Impacted Files | Coverage Δ | |
---|---|---|
ArithmeticTools/Rational.swift | 69.44% <100%> (+2.15%) |
:arrow_up: |
ArithmeticToolsTests/RationalTests.swift | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update cbb65aa...e365ae9. Read the comment docs.
We might want to change the contract/documentation of this function... maybe the asserts should be preconditions? Technically if you're in release mode and the asserts are gone you could get a value that isn't equal to the original Rational. So maybe we write in the contract that you need to be sure you can represent it with that numerator/denominator before proceeding?
Fixes #110. Also does math using doubles rather than floats.
Also, respelling(denominator:) now guards against the case where numerator==0.