mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix error
This commit is contained in:
parent
ec281cd703
commit
6663f21fdd
@ -49,9 +49,10 @@ struct LCMImpl
|
||||
*/
|
||||
|
||||
using Int = typename NumberTraits::ToInteger<Result>::Type;
|
||||
using Unsigned = std::make_unsigned_t<Int>;
|
||||
|
||||
Int val1 = abs<Int>(a) / std::gcd(Int(a), Int(b));
|
||||
Int val2 = abs<Int>(b);
|
||||
Unsigned val1 = abs<Int>(a) / std::gcd(Int(a), Int(b));
|
||||
Unsigned val2 = abs<Int>(b);
|
||||
|
||||
/// Overflow in implementation specific way.
|
||||
return Result(val1 * val2);
|
||||
|
@ -2,7 +2,7 @@
|
||||
30
|
||||
30
|
||||
30
|
||||
18446744073709551360
|
||||
-256
|
||||
-256
|
||||
-256
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
|
@ -4,7 +4,7 @@ SELECT lcm(15, -10);
|
||||
SELECT lcm(-15, -10);
|
||||
|
||||
-- Implementation specific result on overflow:
|
||||
SELECT lcm(256, 9223372036854775807);
|
||||
SELECT lcm(256, -9223372036854775807);
|
||||
SELECT lcm(-256, 9223372036854775807);
|
||||
SELECT lcm(-256, -9223372036854775807);
|
||||
SELECT ignore(lcm(256, 9223372036854775807));
|
||||
SELECT ignore(lcm(256, -9223372036854775807));
|
||||
SELECT ignore(lcm(-256, 9223372036854775807));
|
||||
SELECT ignore(lcm(-256, -9223372036854775807));
|
||||
|
Loading…
Reference in New Issue
Block a user