Libraryless. Click here for Pure Java version (4968L/28K).
1 | srecord Seconds(double seconds) is Comparable<Seconds> { |
2 | double seconds aka get aka getDouble() { ret seconds; } |
3 | |
4 | toString { ret formatDouble(seconds, 3) + " s"; } |
5 | |
6 | public int compareTo(Seconds s) { |
7 | ret cmp(seconds, s.seconds); |
8 | } |
9 | |
10 | Seconds div(double x) { ret Seconds(get()/x); } |
11 | Seconds minus(Seconds x) { ret Seconds(get()-x!); } |
12 | } |
Began life as a copy of #1032953
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033101 |
Snippet name: | Seconds |
Eternal ID of this version: | #1033101/4 |
Text MD5: | 879e48efbcab99a3d24ce63886462f67 |
Transpilation MD5: | f4df19976b193d45386547a67c8f197a |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-23 05:36:13 |
Source code size: | 365 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 179 / 335 |
Version history: | 3 change(s) |
Referenced in: | [show references] |