Closed GilesBathgate closed 2 years ago
Also note (f/5)^2
= f^2/5^2
;)
Unfortunately the OSX compiler doesn't recognize that syntax:
/Users/runner/work/MK404/MK404/parts/components/PINDA.cpp:47:25: error: result of '10^2' is 8; did you mean '1e2'? [-Werror,-Wxor-used-as-pow]
if (fEdistSquared<(10^2))
~~^~
1e2
/Users/runner/work/MK404/MK404/parts/components/PINDA.cpp:47:25: note: replace expression with '0xA ^ 2' or use 'xor' instead of '^' to silence this warning
... and more importantly, ^
is bitwise XOR, not "power"
@vintagepc Oh dear, schoolboy error. I've fixed it.
Merging #342 (5a9e9c3) into master (c1a0c6b) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #342 +/- ##
=======================================
Coverage 91.14% 91.14%
=======================================
Files 166 166
Lines 7692 7692
=======================================
Hits 7011 7011
Misses 681 681
Impacted Files | Coverage Δ | |
---|---|---|
parts/components/PINDA.cpp | 96.87% <100.00%> (ø) |
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 c1a0c6b...5a9e9c3. Read the comment docs.
Description
Minor performance tweak. When doing distance comparisons (c^2 = a^2+b^2), you can calculate c < 10, or you can do c^2 < 100.
Behaviour/ Breaking changes
Expect the same behaviour, and probably no noticeable performance gain, but still...
Have you tested the changes?
Yes, seems to work with MK3 as before.