MCPcopy Create free account
hub / github.com/MenoData/Time4J / ofPosixSeconds

Method ofPosixSeconds

base/src/main/java/net/time4j/MachineTime.java:328–338  ·  view source on GitHub ↗
(double seconds)

Source from the content-addressed store, hash-verified

326 * @since 2.0
327 */
328 public static MachineTime<TimeUnit> ofPosixSeconds(double seconds) {
329
330 if (Double.isInfinite(seconds) || Double.isNaN(seconds)) {
331 throw new IllegalArgumentException("Invalid value: " + seconds);
332 }
333
334 long secs = (long) Math.floor(seconds);
335 int fraction = (int) ((seconds - secs) * MRD);
336 return ofPosixUnits(secs, fraction);
337
338 }
339
340 /**
341 * <p>Creates a machine time duration on the POSIX scale. </p>

Callers 6

ofPosixSecondsDoubleMethod · 0.95
summingUpPosixMethod · 0.95
multipliedByMethod · 0.95
dividedByMethod · 0.95

Calls 5

ofPosixUnitsMethod · 0.95
floorMethod · 0.80
subtractMethod · 0.80
isInfiniteMethod · 0.45
valueOfMethod · 0.45

Tested by 4

ofPosixSecondsDoubleMethod · 0.76
summingUpPosixMethod · 0.76