mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
fixed contexpr modifier build, updated tests
This commit is contained in:
parent
19fcea88f2
commit
5c77ae914f
@ -14,7 +14,7 @@ namespace ErrorCodes
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr bool allowType(const DataTypePtr& type) noexcept
|
||||
bool allowType(const DataTypePtr& type) noexcept
|
||||
{
|
||||
const WhichDataType t(type);
|
||||
return t.isInt() || t.isUInt() || t.isFloat() || t.isDecimal();
|
||||
|
@ -17,16 +17,8 @@ struct RationalFraction
|
||||
Float64 numerator{0};
|
||||
Denominator denominator{0};
|
||||
|
||||
Float64 NO_SANITIZE_UNDEFINED result() const
|
||||
{
|
||||
if constexpr (std::numeric_limits<Float64>::is_iec559)
|
||||
return static_cast<Float64>(numerator) / denominator; /// allow division by zero
|
||||
|
||||
if (denominator == static_cast<Denominator>(0))
|
||||
return static_cast<Float64>(0);
|
||||
|
||||
return static_cast<Float64>(numerator / denominator);
|
||||
}
|
||||
/// Allow division by zero as sometimes we need to return NaN.
|
||||
Float64 NO_SANITIZE_UNDEFINED result() const { return numerator / denominator; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,7 @@ namespace ErrorCodes
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr bool allowTypes(const DataTypePtr& left, const DataTypePtr& right) noexcept
|
||||
bool allowTypes(const DataTypePtr& left, const DataTypePtr& right) noexcept
|
||||
{
|
||||
const WhichDataType l_dt(left), r_dt(right);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user