Given two integer a and b, find whether their product (a x b) exceed the signed 64 bit integer or not. If it exceed print Yes else print No.
Input : a = 100, b = 200 Output : No Input : a = 10000000000, b = -10000000000 Output : Yes
- If either of the number is 0, then it will never exceed the range.
- Else if the product of the two divided by one equals the other, then also it will be in range.
- In any other case overflow will occur.
Time complexity : O(1)
- How to avoid overflow in modular multiplication?
- Reverse digits of an integer with overflow handled
- Program to check if tank will overflow, underflow or filled in given time
- Heap overflow and Stack overflow
- Check if two Integer are anagrams of each other
- Check if the given array contains all the divisors of some integer
- Check if an integer can be expressed as a sum of two semi-primes
- Buffer Overflow Attack with Example
- Compute average of two numbers without overflow
- Booth’s Multiplication Algorithm
- Multiplication of two complex numbers given as strings
- Right most non-zero digit in multiplication of array elements
- Sum of multiplication of triplet of divisors of a number
- Count divisors of array multiplication
- Multiplication on Array : Range update query in O(1)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.