import java.math.*; public class p { public static void main(String args[]) { BigDecimal mol = new BigDecimal(2); BigDecimal deno = new BigDecimal(7); mol = mol.pow(14); deno = deno.pow(14); System.out.println("mol: " + mol); System.out.println("deno: " + deno); BigDecimal result = mol.divide(deno,10,RoundingMode.HALF_UP); double ans = result.doubleValue(); System.out.println("ans: " + ans); } } //mol: 16384 //deno: 678223072849 //ans: 2.42E-8
p.java (2^14/2^14)
最新推荐文章于 2022-12-15 23:27:42 发布