All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.lang.StrictMath Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2020 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package java.lang;

/** StrictMath utility methods and constants. */
public final class StrictMath {

  public static final double E = Math.E;
  public static final double PI = Math.PI;

  public static double abs(double x) {
    return Math.abs(x);
  }

  public static float abs(float x) {
    return Math.abs(x);
  }

  public static int abs(int x) {
    return Math.abs(x);
  }

  public static double acos(double x) {
    return Math.acos(x);
  }

  public static int addExact(int x, int y) {
    return Math.addExact(x, y);
  }

  public static long addExact(long x, long y) {
    return Math.addExact(x, y);
  }

  public static double asin(double x) {
    return Math.asin(x);
  }

  public static double atan(double x) {
    return Math.atan(x);
  }

  public static double atan2(double y, double x) {
    return Math.atan(x);
  }

  public static double ceil(double x) {
    return Math.ceil(x);
  }

  public static double copySign(double magnitude, double sign) {
    return Math.copySign(magnitude, sign);
  }

  public static float copySign(float magnitude, float sign) {
    return Math.copySign(magnitude, sign);
  }

  public static double cos(double x) {
    return Math.cos(x);
  }

  public static double cosh(double x) {
    return Math.cosh(x);
  }

  public static double exp(double x) {
    return Math.exp(x);
  }

  public static double expm1(double x) {
    return Math.expm1(x);
  }

  public static double floor(double x) {
    return Math.floor(x);
  }

  public static int floorDiv(int dividend, int divisor) {
    return Math.floorDiv(dividend, divisor);
  }

  public static long floorDiv(long dividend, long divisor) {
    return Math.floorDiv(dividend, divisor);
  }

  public static int floorMod(int dividend, int divisor) {
    return Math.floorMod(dividend, divisor);
  }

  public static long floorMod(long dividend, long divisor) {
    return Math.floorMod(dividend, divisor);
  }

  public static double hypot(double x, double y) {
    return Math.hypot(x, y);
  }

  public static double log(double x) {
    return Math.log(x);
  }

  public static double log10(double x) {
    return Math.log10(x);
  }

  public static double log1p(double x) {
    return Math.log1p(x);
  }

  public static double max(double x, double y) {
    return Math.max(x, y);
  }

  public static float max(float x, float y) {
    return Math.max(x, y);
  }

  public static int max(int x, int y) {
    return Math.max(x, y);
  }

  public static long max(long x, long y) {
    return Math.max(x, y);
  }

  public static double min(double x, double y) {
    return Math.min(x, y);
  }

  public static float min(float x, float y) {
    return Math.min(x, y);
  }

  public static int min(int x, int y) {
    return Math.min(x, y);
  }

  public static long min(long x, long y) {
    return Math.min(x, y);
  }

  public static int multiplyExact(int x, int y) {
    return Math.multiplyExact(x, y);
  }

  public static long multiplyExact(long x, long y) {
    return Math.multiplyExact(x, y);
  }

  public static double pow(double x, double exp) {
    return Math.pow(x, exp);
  }

  public static double random() {
    return Math.random();
  }

  public static double rint(double x) {
    return Math.rint(x);
  }

  public static long round(double x) {
    return Math.round(x);
  }

  public static int round(float x) {
    return Math.round(x);
  }

  public static double scalb(double d, int scaleFactor) {
    return Math.scalb(d, scaleFactor);
  }

  public static float scalb(float f, int scaleFactor) {
    return Math.scalb(f, scaleFactor);
  }

  public static double signum(double d) {
    return Math.signum(d);
  }

  public static float signum(float f) {
    return Math.signum(f);
  }

  public static double sin(double x) {
    return Math.sin(x);
  }

  public static double sinh(double x) {
    return Math.sinh(x);
  }

  public static double sqrt(double x) {
    return Math.sqrt(x);
  }

  public static int subtractExact(int x, int y) {
    return Math.subtractExact(x, y);
  }

  public static long subtractExact(long x, long y) {
    return Math.subtractExact(x, y);
  }

  public static double tan(double x) {
    return Math.tan(x);
  }

  public static double tanh(double x) {
    return Math.tanh(x);
  }

  public static double toDegrees(double x) {
    return Math.toDegrees(x);
  }

  public static int toIntExact(long x) {
    return Math.toIntExact(x);
  }

  public static double toRadians(double x) {
    return Math.toRadians(x);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy