Merge branch 'v0.20.x'
This commit is contained in:
@@ -34,7 +34,8 @@ struct FloatToIntegerSampleConvert {
|
||||
typedef typename SrcTraits::long_type SL;
|
||||
typedef typename DstTraits::value_type DV;
|
||||
|
||||
static constexpr SV factor = 1 << (DstTraits::BITS - 1);
|
||||
static constexpr SV factor = uintmax_t(1) << (DstTraits::BITS - 1);
|
||||
static_assert(factor > 0, "Wrong factor");
|
||||
|
||||
gcc_const
|
||||
static DV Convert(SV src) noexcept {
|
||||
@@ -53,7 +54,8 @@ struct IntegerToFloatSampleConvert {
|
||||
typedef typename SrcTraits::value_type SV;
|
||||
typedef typename DstTraits::value_type DV;
|
||||
|
||||
static constexpr DV factor = 0.5 / (1 << (SrcTraits::BITS - 2));
|
||||
static constexpr DV factor = 1.0 / FloatToIntegerSampleConvert<F, Traits>::factor;
|
||||
static_assert(factor > 0, "Wrong factor");
|
||||
|
||||
gcc_const
|
||||
static DV Convert(SV src) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user