[Boost-bugs] [Boost C++ Libraries] #11389: Bug: Unit precision is restricted to double when using conversion constants

Subject: [Boost-bugs] [Boost C++ Libraries] #11389: Bug: Unit precision is restricted to double when using conversion constants
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-06-10 15:40:49


#11389: Bug: Unit precision is restricted to double when using conversion constants
------------------------------------+-----------------------------
 Reporter: Roger Leigh <rleigh@…> | Owner: matthiasschabel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
------------------------------------+-----------------------------
 From BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS in
 boost/units/conversions.hpp:

 {{{
 BOOST_UNITS_DEFINE_CONVERSION_FACTOR(namespace_::name_ ## _base_unit,
 unit, double, factor); \
 }}}

 Note the type of the conversion factor value is forced unconditionally to
 be double.

 It would be nice if the precision of this constant could be either made
 more flexible, or made as precise as possible with rounding to a lower-
 precision constant when lower-precision types are used. For example,
 using long double would allow higher-precision constants and conversions,
 but this isn't possible at present since even if a quantity<T, long
 double> is used, the conversions are still being restricted to double
 precision.


 Kind regards,
 Roger

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11389>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC