On 8/15/14 4:08 AM, Harald Alvestrand wrote:
> When something's a number in Javascript, it's perfectly legal to write
> an expression like 16/9 in that space.
>
> Your other alternatives - { num: 16, den: 9 } and "16/9" - are, to me,
> more complex and less readable - the author has to remember that while
> he thinks of it as a number, he has to remember that there is a
> special syntax that is only used for expressing numbers in this
> particular place.
>
> Specifying an epsilon allows the author to write the number in most
> fashions he's used to, and have the result of the comparision be the same.
>
> I believe the epsilon solution is the easiest one for authors.
+1 on 16/9 (or width/height for that matter) being the ideal JS
expression, and on the alternatives being atypical.
.: Jan-Ivar :.