What is the modulo operator for longs in Java?

前端 未结 3 1380
清酒与你
清酒与你 2021-01-11 10:25

How do I find the modulo (%) of two long values in Java? My code says \'Integer number too large\' followed by the number I\'m trying to mod. I tried casting it to a long bu

3条回答
  •  别那么骄傲
    2021-01-11 10:30

    You can also try working with the BigInteger class which has a remainder() method that works similarly to %.

提交回复
热议问题