Android Int Overflow Check multiply(int x, int y)

Here you can find the source of multiply(int x, int y)

Description

Multiply two fixed-point values.

Parameter

Parameter Description
x a parameter
y a parameter

Declaration

public static int multiply(int x, int y) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  w w w.  j  a  v a  2  s  . co m*/
     * Multiply two fixed-point values.
     * @param x
     * @param y
     * @return
     */
    public static int multiply(int x, int y) {
        long z = (long) x * (long) y;
        return ((int) (z >> 16));
    }
}

Related

  1. addAndCheck(int x, int y)
  2. constrain(int value, int min, int max)
  3. mulAndCheck(int x, int y)
  4. stirlingS2(final int n, final int k)
  5. subAndCheck(int x, int y)
  6. multiply(int x, int y)
  7. sqrt(int n)
  8. divide(int x, int y)