QtMath now provides a M_PI constant, operations with degrees and qRound()
AbandonedPublic

Authored by Shroudmaster on Oct 26 2018, 9:59 PM.

Details

Summary

Deleted the macros defining ROUND2INT and used qRound() instead. There's one instance where C++'s round() is used instead, since the original line is (double)ROUND2INT. Macros
defining operations with degrees were changed accordingly

Diff Detail

Repository
R337 KTurtle
Branch
Math
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4219
Build 4237: arc lint + arc unit
Shroudmaster created this revision.Oct 26 2018, 9:59 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptOct 26 2018, 9:59 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
Shroudmaster requested review of this revision.Oct 26 2018, 9:59 PM
aacid added a subscriber: aacid.Oct 26 2018, 10:26 PM
aacid added inline comments.
src/directiondialog.cpp
375

Are you sure about this?

qRound(-0.5) returns 0
ROUND2INT(-0.5) returns -1

Have you tried to run any tests to see how the output would change when using round vs qRound?
It seams that round would act the same as ROUND2INT as both round down (qRound rounds up).

Shroudmaster abandoned this revision.Oct 27 2018, 3:42 PM
Shroudmaster added inline comments.
src/directiondialog.cpp
375

This method is only called when the degree is between 0 or 360. From what I've seem, the round macro is only used for positive numbers, though it seems to me that this macro is more likely an error than an intended deviation from regular math

Yeah you guys are right let me just study these errors and I'll make a new review