Java sqr sqr(int x)

Here you can find the source of sqr(int x)

Description

Calculate a square of a number

License

Open Source License

Parameter

Parameter Description
x the number

Return

x^2

Declaration

public static int sqr(int x) 

Method Source Code

//package com.java2s;
/*/*ww  w.  j  a  va 2 s  . c  o m*/
 * ArikTools
 * Copyright (C) Arik Z.Lakritz, Peter Macko, and David K. Wittenberg
 * 
 * This file is part of ArikTools.
 *
 * ArikTools is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ArikTools is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ArikTools.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * Calculate a square of a number
     *
     * @param x the number
     * @return x^2
     */
    public static int sqr(int x) {
        return x * x;
    }

    /**
     * Calculate a square of a number
     *
     * @param x the number
     * @return x^2
     */
    public static long sqr(long x) {
        return x * x;
    }

    /**
     * Calculate a square of a number
     *
     * @param x the number
     * @return x^2
     */
    public static float sqr(float x) {
        return x * x;
    }

    /**
     * Calculate a square of a number
     *
     * @param x the number
     * @return x^2
     */
    public static double sqr(double x) {
        return x * x;
    }
}

Related

  1. sqr(final int value)
  2. sqr(float a)
  3. sqr(float x)
  4. sqr(int V)
  5. sqr(int x)
  6. sqRightFunction(int databaseType, String expr, int length)
  7. sqrt(double a)
  8. sqrt(double d)
  9. sqrt(double n)