3 ms·
Why don't you just try what their results are and compare them, then it should be obvious why this is true.
by detaro 10y ago
Why don't you just try what their results are and compare them, then it should be obvious why this is true.
- gus_massa 10y agoI think that the implicit question is: Why someone choose this behavior? [spoiler alert] The idea is that if A={a1, a2, ...} B={b1, b2, ...} are sets, then min(union(A, B)) = min(min(A), min(B)) I don't expect this code will not compile as is in any language, but I hope it's understandable enough. The what happens if A is the empty set? if we define x = min(empty) then min(union(empty, B)) = min(B) min(min(empty), min(B)) = min(x, min(B) so min(B) = min(x, min(B)) Then x must be a number big enough to be bigger than min(B) for any set B. But min(B) can be very big if B has only big numbers, so the only possibility is that x = +infinity.
- nlolks 10y agoThe answer is false. Lookup Math.min and Math.max. Min is assigned Ininity Max is assigned -Infinity To test just run the logic on chrome console.