On Wed, Jun 21, 2006 at 07:45:46PM +1000, O Plameras wrote:
> Graham Smith wrote:
[...]
> >     return [round, rem]
> 
> This is how I'd code this:
> 
> $cat nrs_payroll.rb
> 
> def bodgy_rounding(x)
> 
>       remainder = x % 5.0
>       base_amount = x - remainder
>       remainder > 2 ? (return base_amount+5):(return base_amount)
> end

1) It doesn't pass the test suite as defined (and verified with the customer
for correctness);

2) It doesn't return the array that Graham's code does, and hence isn't an
equivalent implementation in any way.

- Matt
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to