Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When the Hourly Fare rate is noted as 30 + max(0, Speed - 12) that's missing the 2.50 multipler right? Really it should be Hourly Rate = 30 + (2.50 * max(0, Speed - 12)).

Or if you prefer Lispy stuff :)

(+ 30 (* 2.5 (max (0 (- speed 12)))))

This then means if you drive at 22mph for 1 hour, you earn 30 + (2.50 * max(0, 10)) or $55 which you also get from 2.50 * 22

Is this just discounting the constant multiplier since it applies to everything and can be pulled out?



A simpler formula is Max(30, Speed x 2.5).


Right, thank you. There seem to be a few instances in the article where there's either more complexity than needed or missing/incomplete information




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: