src/java.base/share/classes/java/time/Instant.java
Print this page
rev 12809 : 8023217: Additional floorDiv/floorMod/multiplyExact methods for java.lang.Math
Summary: Add new methods with long, int signatures.
Reviewed-by: XXX
*** 340,350 ****
* @return an instant, not null
* @throws DateTimeException if the instant exceeds the maximum or minimum instant
*/
public static Instant ofEpochMilli(long epochMilli) {
long secs = Math.floorDiv(epochMilli, 1000);
! int mos = (int)Math.floorMod(epochMilli, 1000);
return create(secs, mos * 1000_000);
}
//-----------------------------------------------------------------------
/**
--- 340,350 ----
* @return an instant, not null
* @throws DateTimeException if the instant exceeds the maximum or minimum instant
*/
public static Instant ofEpochMilli(long epochMilli) {
long secs = Math.floorDiv(epochMilli, 1000);
! int mos = Math.floorMod(epochMilli, 1000);
return create(secs, mos * 1000_000);
}
//-----------------------------------------------------------------------
/**