A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

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

favila
2015-03-18

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?

luke
2015-03-18

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!

RReverser
2015-06-16

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?

luke
2015-06-16

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