zoukankan      html  css  js  c++  java
  • JAVA BigInteger

    java.math包中有两个很有用的类:BigInteger(整数)和BigDecimal(浮点数),这两个类可以处理包含任意长度数字序列的值。

    声明:BigInteger a = BigInteger.valueOf(100);

    一些API:
    BigInteger add(BigInteger other)
    BigInteger subtract(BigInteger other)
    BigInteger multiply(BigInteger other)
    BigInteger divide(BigInteger other)
    BigInteger mod(BigInteger other)
    int compareTo(BigInteger other) //相等返回0,小于返回负数,大于返回正数
    static BigInteger valueOf(long x) //返回值等于x的大整数

     BigDecimal与BigInteger相仿只是在valueof方法中多了一个

    static BigDecimal valueOf(long x, int scale)//返回x/(10^scale)
    诸位正值青春年少,一定恣情放纵,贪恋香艳梅施之情,喜欢风流雅韵之事,洒脱木拘。然而诸位可知,草上露一碰即落,竹上霜一触即溶,此种风情难于长久。
  • 相关阅读:
    初识软件工程
    00.JS前言
    01.JS语法规范、变量与常量
    02.JS数据类型与数据类型转换
    03.JS运算符
    04.JS逻辑结构
    05.JS函数
    06.JS对象-1
    08.JS单词整理
    00.ES6简介
  • 原文地址:https://www.cnblogs.com/shilipojianshen/p/12718201.html
Copyright © 2011-2022 走看看