BigDecimal求余操作如下:
package com.qiu.lin.he; import java.math.BigDecimal; public class CeShi { public static void main(String[] args) { BigDecimal bg = BigDecimal.valueOf(11); BigDecimal om2 = BigDecimal.valueOf(25); System.out.println(om2.divideAndRemainder(bg)[1]);//取余 } }
时间: 2024-10-08 18:26:14