Definitions of PI...
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
Medium
|
Wayne Stambaugh |
Bug Description
Kicad got plenty of them. (Or uses some hardcoded ones).
kicad $ ack --cpp "3\.141"
include/
887: const double our_pi=
include/fctsys.h
29:#define M_PI 3.141592653
pcb_calculator/
37:#define M_PI 3.1415926535897
pcbnew/muonde.cpp
323: double increment_angle = (double) a_ArcAngle * 3.14159 / 1800 / seg_count;
pcbnew/
140: s_Correction = 1.0 / cos( 3.14159265 / s_CircleToSegme
polygon/clipper.cpp
54:static double const pi = 3.1415926535897
I don't know if it'll break some existing stuff if these definitions are changed, but one definition with the same value would be nice. There's also one more from <math.h> (which differs at least on my system with all of the ones used in kicad).
Related branches
Changed in kicad: | |
importance: | Undecided → Medium |
assignee: | nobody → Wayne Stambaugh (stambaughw) |
Changed in kicad: | |
status: | Fix Committed → Fix Released |
Fixed as much as can be fixed in testing branch r3773 with the following exceptions:
include/ boost/polygon/ polygon_ set_data. hpp 3.1415926535897 932384626433832 795028841971;
887: const double our_pi=
and:
polygon/clipper.cpp 93238;
54:static double const pi = 3.1415926535897
are imported from external projects so any changes would be lost the next time these sources are updated.
This definition:
pcb_calculator/ transline/ units.h 932384626433832 795029 /* pi */
37:#define M_PI 3.1415926535897
does not include wxWidgets so adding #include <wx/wx.h> would only add an extra dependency which is not required.