萌新求教,浮点数除法问题

运行这个程序如果high=0;那么输出是Infinity。
我在网络上查了是因为浮点数的问题,导致程序在除数为0时候没有异常
那么如果我要使它有异常(除数为0),并且抛出,要怎么做呢?

 public class TestBml01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入身高:");
        double high = scanner.nextDouble();
        System.out.println("请输入体重:");
        double weight = scanner.nextDouble();
        scanner.close();
        try {
            double bml = weight / Math.sqrt(high);
            System.out.println("您的bml为:" + bml);
        } catch (ArithmeticException e) {
            System.out.println("身高不能为零");
        }


    }

}

catch (ArithmeticException e) {
System.out.println("身高不能为零");
throw e;
}

“如果我要**抛出异常**,要怎么做呢?”给你个参考,,, throw new Exception();

 try {
            throw new Exception();
        } catch (Exception e) {
            e.printStackTrace();
        }