What is 49%10 in java?
Answers
Answered by
1
Integers are only 32 bits. This means that its max value is 2^31 -1. As you see, for very small numbers, you quickly have a result which can't be represented by an integer anymore. That's why Math.powuses double.
If you want arbitrary integer precision, use BigInteger.pow. But it's of course less efficient.
If you want arbitrary integer precision, use BigInteger.pow. But it's of course less efficient.
Similar questions
Math,
7 months ago
Math,
7 months ago
English,
1 year ago
Biology,
1 year ago
Business Studies,
1 year ago
Business Studies,
1 year ago
Business Studies,
1 year ago