(double seconds)
| 384 | * @since 2.0 |
| 385 | */ |
| 386 | public static MachineTime<SI> ofSISeconds(double seconds) { |
| 387 | |
| 388 | if (Double.isInfinite(seconds) || Double.isNaN(seconds)) { |
| 389 | throw new IllegalArgumentException("Invalid value: " + seconds); |
| 390 | } |
| 391 | |
| 392 | long secs = (long) Math.floor(seconds); |
| 393 | int fraction = (int) ((seconds - secs) * MRD); |
| 394 | return ofSIUnits(secs, fraction); |
| 395 | |
| 396 | } |
| 397 | |
| 398 | /** |
| 399 | * <p>Creates a machine time duration on the UTC scale. </p> |