Talk:Arithmetic/Rational: Difference between revisions

m
→‎Too long: added comments about REXX code and subroutines, commented about brevity and whitespace. -- ~~~~
(→‎Too long language examples: relax the requirement maybe)
m (→‎Too long: added comments about REXX code and subroutines, commented about brevity and whitespace. -- ~~~~)
 
(One intermediate revision by one other user not shown)
Line 19:
:Maybe still too long?... I've finished a Objective-C implementation... and it is 276 line long (and lacks pow); maybe not too much... I post it after few testing. --[[User:ShinTakezou|ShinTakezou]] 21:13, 14 February 2009 (UTC)
:And it's going worse with Fortran; I've implemented only = and + (and not all possible interfaces), and it takes already 120 lines of code... --[[User:ShinTakezou|ShinTakezou]] 23:27, 14 February 2009 (UTC)
 
:I had the same problem with my REXX example, I had to resort to making some subroutines into ''one-liners'' (subroutines that detracted from the task's requirements), and remove quite a bit of whitespace to keep the program brief (as possible). -- [[User:Gerard Schildberger|Gerard Schildberger]] 08:10, 8 January 2013 (UTC)
 
=== languages that already implement rational numbers? ===
Line 47 ⟶ 49:
 
: You can either write an elaborate, robust example, or a short, clear example, but rarely both. And it doesn't help that this task is asking for too much. Why integer division operator? Why abs aperator? What's the "etc" in "cast int to frac, etc"? For a fraction implemetation to be reasonably useful, arbitrary length integer like GMP is almost a must, but GMP already implements rationals, making an implemetation pointless. I think the task could be changed so that if an example implementation made the basic idea of a fraction class clear enough, and good enough to do the given test, it should be considered done. After all, code here intend to demonstrate, not to serve production needs. --[[User:Ledrug|Ledrug]] 02:10, 30 July 2011 (UTC)
:: +1 on that. --[[User:Paddy3118|Paddy3118]] 03:03, 30 July 2011 (UTC)