Skip to content

Instantly share code, notes, and snippets.

View hetykai's full-sized avatar
🏠
Working from home

hetykai

🏠
Working from home
View GitHub Profile
@hetykai
hetykai / Arith.java
Created December 7, 2015 10:17 — forked from binjoo/Arith.java
JAVA:BigDecimal加减乘除运算
import java.math.BigDecimal;
/**
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精确的浮点数运算,包括加减乘除和四舍五入。
*/
public class Arith { // 默认除法运算精度
private static final int DEF_DIV_SCALE = 10; // 这个类不能实例化
private Arith() {
}