D
D
Denis Nikolaev2019-03-24 13:35:34
Java
Denis Nikolaev, 2019-03-24 13:35:34

How do you know which remainder is correct?

there is this miniature code:

public class Test {
    public static void main(String[] args) {
        int sec = 548632;
        int days =  sec / 3600;
        int ost = sec % 3600;

        System.out.println(days);
        System.out.println(ost);
    }
}

The result is:
152
1432
Process finished with exit code 0

But on the calculator, the balance is different:
5c975d5d8b6c6880772934.png
CHAYDNT? Or am I misunderstanding the essence of the remainder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2019-03-24
@SamFlynn

Yes, it's wrong. The remainder is that part of the dividend that can no longer be divided by the divisor so that it turns out to be an integer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question