Math.min/max (int) -> signed?


Spec says Math.min and Math.max have this type signature:

(int, int…) → signed ∧
(double, double…) → double

(int, int…) → signed seems wrong. Shouldn’t it be (int, int…) → int?


Ah, yes, this is a bug in the spec. Actually, the signature currently in Firefox is (signed, signed…) → signed since min/max do a comparison and comparison cares about signedness and int means “could be either signed or unsigned”. This was actually missing from the current errata due to be included in the next update. Good catch, thanks!


Is spec still going to be updated with this? If not, where can I find the latest version of it that is actually used in Firefox?


I’m sorry, the spec has not been updated yet; the maintainer (Dave Herman) has been blocked on other things recently.