相关疑难解决方法(0)

Java中的大数字

我如何在Java中使用极大数字进行计算?

我已经尝试long但最大限度为9223372036854775807,并且当使用整数时,它不能保存足够的数字,因此不够准确,无法满足我的需要.

有没有办法解决?

java integer numbers biginteger

90
推荐指数
5
解决办法
20万
查看次数

为什么二次方程的根结果是NaN?(JAVA)

为什么写出来 控制台中的根是NaN和NaN?我读过有关NaN的,但我没有找到合适的解决方案,我怎么能修复的错误......我已经试过铸造翻番判别根源,但不起作用.有人可以帮助我,在哪里以及我需要重写什么?

public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    Pattern newlineOrSpace = Pattern.compile(System
            .getProperty("line.separator")
            + "|\\s");
    sc.useDelimiter(newlineOrSpace);
    System.out.print("Enter a, b, c: ");
    double a = sc.nextDouble();
    double b = sc.nextDouble();
    double c = sc.nextDouble();
    // System.out.format("a = %f, b = %f, c = %f", a, b, c);

    double root1;
    double root2;
    double discriminant;
    discriminant = Math.sqrt(b * b - 4 * a * c);
    if (discriminant > 0) …
Run Code Online (Sandbox Code Playgroud)

java math

3
推荐指数
2
解决办法
9865
查看次数

标签 统计

java ×2

biginteger ×1

integer ×1

math ×1

numbers ×1