您的位置: 首页 > 技术问答 > 如何在Java中将两个大整数相除? 如何在Java中将两个大整数相除? 分类: 技术问答 • 2022-05-10 11:35:04 问题描述: 我想将两个大整数相除 a = 23546654 b = 24979799 并将结果翻倍. 答 尝试 double x = ((double) a) / ((double) b) 首先将您的整数转换为双精度,然后进行除法.如果您有BigInteger(标记指示),则可以使用 which first converts your ints to doubles and then does the division. If you have BigIntegers (which your tag indicates) you may use BigInteger.doubleValue() to extract the double value.