请注意,java确实有用于处理大于长整数的整数的类:java.math.BigInteger. 它甚至为您正在实施的“模块化电源”操作提供了方便快捷的方法:int以及long具有最大值。取决于a以及ba^b超过最大值并溢出。最后的模运算将作用于错误的溢出值,结果将被关闭。模的问题是,你可以在你的计算过程中应用模,基本上只要你想,而不改变
In my opinion, it is not a good practice to depend solely on the default time zone of the JVM. It is recommended to explicitly state your preferred time zone and include the optionalZoneIdargument. ZoneId z = ZoneId.of( "America/Montreal" ) ; // Or get the JVM’s current default t...