Auf Thema antworten

Also man könnte das so machen

[CODE=java]    public static double createDouble(int a, int b) {

        double decimalPlace = b;

        while (b != 0) {

            b /= 10;

            decimalPlace /= 10;

        }

        return a + decimalPlace;

    }[/CODE]

das ist aber ungenau: [ICODE]createDouble(12, 4567001) => 12.456700099999999[/ICODE]


Du müsstest das noch etwas umstellen.



Oben