Repository navigation
implement forceFloat32 to encode numbers in float32 instead of float64 - #79
Conversation
Codecov Report
@@ Coverage Diff @@
## master #79 +/- ##
==========================================
+ Coverage 98.15% 98.16% +0.01%
==========================================
Files 15 15
Lines 919 927 +8
Branches 187 189 +2
==========================================
+ Hits 902 910 +8
Misses 17 17
Continue to review full report at Codecov.
|
|
This is more of "force" than "prefer". Why not just test whether the value can be losslessly represented as a float32 and use that, otherwise use float64? |
|
@michaelficarra Thanks for your advice. s/prefer/force/ at 91eeb98.
I think it should make encoding much slower than the |
preferFloat32 to encode numbers in float32 instead of float64forceFloat32 to encode numbers in float32 instead of float64
If the double precision is not required, float32 is more compact than float64.
It is useful if the precisions of numbers do not matter.