Boost C++ Libraries: Ticket #6893: Inaccurate Radians/Degrees conversion https://svn.boost.org/trac10/ticket/6893 <p> LS, </p> <p> The conversion from angles in degrees to radians currently uses a conversion factor of 6.28318530718/360. (File: boost\units\base_units\angle\degree.hpp), which equals 0.0174532925199444444... </p> <p> This is unnecessarily inaccurate (only 14 significant digits are correct) and gives problems in my application - the actual value reads: 0.017453292519943295769236907684886127134428718885417... </p> <p> Using this value improves conversion accuracy significantly. </p> <p> Please consider using this more accurate value. Alternatively, the use of boost::math::constants could be considered, making the factor: boost::math::constants::pi&lt;double&gt;()/180.0 which works fine as well. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6893 Trac 1.4.3 anonymous Mon, 03 Nov 2014 16:04:34 GMT <link>https://svn.boost.org/trac10/ticket/6893#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:1</guid> <description> <p> Any update on this? I see the same constant is used in boost 1.54. It would be good to not introduce unnecessary and avoidable inaccuracies in such a foundational location. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Wed, 05 Nov 2014 08:25:38 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/6893#comment:2 https://svn.boost.org/trac10/ticket/6893#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matthias Schabel</span> to <span class="trac-author">Jürgen Hunold</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket anonymous Fri, 16 Jan 2015 09:02:26 GMT <link>https://svn.boost.org/trac10/ticket/6893#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:3</guid> <description> <p> There already exist the necessary constants </p> <p> <code>boost::math::constants::radian</code> (=180/pi) </p> <p> and </p> <p> <code>boost::math::constants::degree</code> (=pi/180) </p> </description> <category>Ticket</category> </item> <item> <author>Roger Leigh <rleigh@…></author> <pubDate>Fri, 22 May 2015 20:32:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6893#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:4</guid> <description> <p> The constants in boost/match/constants/constants.hpp certainly appear to have the necessary accuracy. I was somewhat surprised to see only 4 d.p. accuracy when using boost::units conversions between rad/grad/deg due to the low precision constants used here while I was writing unit tests to validate the conversions. Updating it to use the math constants would be much appreciated. Do you need a patch providing? </p> </description> <category>Ticket</category> </item> <item> <author>rleigh@…</author> <pubDate>Wed, 10 Jun 2015 15:22:09 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6893 https://svn.boost.org/trac10/ticket/6893 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-angle-precision.patch</span> </li> </ul> <p> Use boost::math pi constant to increase precision </p> Ticket Roger Leigh <rleigh@…> Wed, 10 Jun 2015 15:26:58 GMT <link>https://svn.boost.org/trac10/ticket/6893#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:5</guid> <description> <p> I have added a patch which makes the suggested change to use boost::math::constants::pi (actually, two_pi) to improve the precision. I've tested this locally and all my own unit tests continue to pass with the patched headers. </p> </description> <category>Ticket</category> </item> <item> <author>Roger Leigh <rleigh@…></author> <pubDate>Thu, 11 Jun 2015 07:06:43 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6893 https://svn.boost.org/trac10/ticket/6893 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-angle-precision2.patch</span> </li> </ul> <p> Updated patch; use degree constant directly (not possible for grad--no constant defined) </p> Ticket Roger Leigh <rleigh@…> Mon, 22 Jun 2015 21:21:34 GMT <link>https://svn.boost.org/trac10/ticket/6893#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:6</guid> <description> <p> PR opened: <a class="ext-link" href="https://github.com/boostorg/units/pull/18"><span class="icon">​</span>https://github.com/boostorg/units/pull/18</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 08 Jul 2018 16:19:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6893#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6893#comment:7</guid> <description> <p> Please at least change the value to a more precise value if there is no agreement on the best way to retrieve the good value or if we don't want to introduce dependencies on other boost header. </p> <p> Keeping a needlessly inaccurate value for 6 years is clearly the worst possible situation. </p> </description> <category>Ticket</category> </item> </channel> </rss>