Java Double Number Divide divide(double left, double right)

Here you can find the source of divide(double left, double right)

Description

divide

License

Open Source License

Declaration

public static double divide(double left, double right) 

Method Source Code

//package com.java2s;
/*//from  w  w  w  .  j ava 2 s .c o  m
 * #%~
 * VDM Code Generator Runtime
 * %%
 * Copyright (C) 2008 - 2014 Overture
 * %%
 * This program 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.
 * 
 * This program 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 this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #~%
 */

public class Main {
    public static double divide(double left, double right) {
        if (right == 0L) {
            throw new ArithmeticException("Division by zero is undefined");
        }

        return left / right;
    }
}

Related

  1. divHex(double num)
  2. divide(Double a, Double b)
  3. divide(double a, double b)
  4. divide(Double a, Double b)
  5. divide(double first, double second)
  6. divide(Double numerator, Double denominator)
  7. divide(double v1, double v2)
  8. divide(double x, double y, int scale, RoundingMode roundingMode)
  9. divide(final double n1, final double n2)