Close

Java - Math.multiplyFull() Examples

Java Java API 


Class:

java.lang.Math

java.lang.Objectjava.lang.Objectjava.lang.Mathjava.lang.MathLogicBig

Method:

public static long multiplyFull(int x,
                                int y)

Returns the exact mathematical product of the arguments.

Parameters:
x - the first value
y - the second value
Returns:
the result
Since:
9


Examples


package com.logicbig.example.math;

public class MultiplyFullExample {

public static void main(String... args) {
findMultiplyFull(1235, 2);
findMultiplyFull(0, 2222);
findMultiplyFull(-52121, -12329);
findMultiplyFull(7223, Integer.MIN_VALUE);
findMultiplyFull(Integer.MAX_VALUE, 1131);
}

private static void findMultiplyFull(int x, int y) {
long multiplyFull = Math.multiplyFull(x, y);
System.out.printf("Math.multiplyFull(%s,%s) = %d%n", x, y, multiplyFull);
}
}

Output

Math.multiplyFull(1235,2) = 2470
Math.multiplyFull(0,2222) = 0
Math.multiplyFull(-52121,-12329) = 642599809
Math.multiplyFull(7223,-2147483648) = -15511274389504
Math.multiplyFull(2147483647,1131) = 2428804004757




See Also