mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fix test
This commit is contained in:
parent
22954cc123
commit
65aa226bcd
@ -144,8 +144,17 @@ public:
|
||||
T operator() (const Float64 & x) const
|
||||
{
|
||||
if constexpr (!std::is_floating_point_v<T>)
|
||||
{
|
||||
if (!isFinite(x))
|
||||
{
|
||||
/// When converting to bool it's ok (non-zero converts to true, NaN including).
|
||||
if (std::is_same_v<T, bool>)
|
||||
return true;
|
||||
|
||||
/// Conversion of infinite values to integer is undefined.
|
||||
throw Exception("Cannot convert infinite value to integer type", ErrorCodes::CANNOT_CONVERT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
if constexpr (std::is_same_v<Decimal256, T>)
|
||||
return Int256(x);
|
||||
|
Loading…
Reference in New Issue
Block a user