[RFC] Move arithmetic functions into submodule `FixedPointArithmetic`
This is in preparation for improved overflow handling. (closes #239)
Even though these functions will be exposed differently in the future by the package extension mechanism, I believe that their implementation should be there statically.
There is a slight tradeoff between an ideal module structure and maintainability.
The proposed file structure follows the conventional file structure.
That is, the FixedPoint common implementations are in one arithmetic.jl, and the specializations specific to Fixed and Normed are in *_arithmetic.jl.
In terms of modularity, it might be better to have separate files for each strategy, such as Checked.
However, as noted above, I do not intend for them to be loaded/compiled independently.
Submodule names such as Wrapping are also debatable.
The current proposal comes from the following reasons:
-
CheckedArithmeticconflicts with the package name -
FixedPointCheckedArithmetic,FixedPointChecked, and so on are redundant- They are never exported from
FixedPointNumbers
- They are never exported from
- They are the analogy with
Base.Checked
The automatic formatter has removed the spaces in the type parameters, which I will try to restore later.
Codecov Report
Attention: Patch coverage is 99.01961% with 2 lines in your changes are missing coverage. Please review.
Project coverage is 97.02%. Comparing base (
3a4346c) to head (e967034).
| Files | Patch % | Lines |
|---|---|---|
| src/arithmetic/fixed_arithmetic.jl | 92.00% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #292 +/- ##
==========================================
+ Coverage 96.93% 97.02% +0.08%
==========================================
Files 7 10 +3
Lines 784 806 +22
==========================================
+ Hits 760 782 +22
Misses 24 24
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.