Libraryless. Click here for Pure Java version (5279L/29K).
1 | srecord Ratio(double numerator, double denominator) { |
2 | *(double numerator) { this(numerator, 1); } |
3 | |
4 | double get() { ret doubleRatio(numerator, denominator); } |
5 | |
6 | toString { |
7 | ret numerator+"/"+denominator |
8 | + "=" |
9 | + (denominator == 0 ? "oops" : str(get())); |
10 | } |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033224 |
Snippet name: | Ratio |
Eternal ID of this version: | #1033224/3 |
Text MD5: | 336a6feda3677acc171159bfaabe873d |
Transpilation MD5: | d0382376611ce1312f975a19e7fcbc27 |
Author: | stefan |
Category: | javax / recognition by compression |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-08 09:28:01 |
Source code size: | 290 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 167 / 279 |
Version history: | 2 change(s) |
Referenced in: | [show references] |