• Java 源码 Double


    介绍

    The Double class wraps a value of the primitive type double in an object.

    示例

    public class Test {
      public static void main(String[] args) {
        Double d = Double.valueOf("0.123");
        System.out.println(d);
      }
    }
    

    源码

    public final class Double extends Number implements Comparable<Double> {
    
      public static String toString(double d) {
        return FloatingDecimal.toJavaFormatString(d);
      }
    
      public static double parseDouble(String s) throws NumberFormatException {
        return FloatingDecimal.parseDouble(s);
      }
    
      public static boolean isNaN(double v) {
        return (v != v);
      }
    
      public static boolean isInfinite(double v) {
        return (v == POSITIVE_INFINITY) || (v == NEGATIVE_INFINITY);
      }
    
      public static boolean isFinite(double d) {
        return Math.abs(d) <= DoubleConsts.MAX_VALUE;
      }
    
      private final double value;
    
      public Double(double value) {
        this.value = value;
      }
    
      public Double(String s) throws NumberFormatException {
        value = parseDouble(s);
      }
    }
    
  • 相关阅读:
    通过dockerfile制作nginx镜像
    docker存储卷
    docker容器网络配置
    状态模式
    抽象工厂模式
    观察者模式
    建造者模式
    外观模式
    模板方法模式
    原型模式
  • 原文地址:https://www.cnblogs.com/feiqiangsheng/p/15933314.html
Copyright © 2020-2023  润新知