Java Operators With Examples Java Tutorial
The Modulo Operation Expressed As a Formula As one final means of explication, for those more mathematically inclined, here's a formula that describes the modulo operation a (n * floor(a/n)) By substituting values, we can see how the modulo operation works in practice 100 % 7 = 2 // a = 100, n = 7 1 Introduction This article will show the usage of the modulo operation in Java that computes the remainder after the division of 2 numbers Java uses a specific arithmetic operator the Remainder Operator with the symbol % 2 Java Modulus – Use Cases In this section we show same useful use cases
Java modulus operator explained