Re: Feedback on hypot and hypot2

2012-08-16 Thread David Bruant
Le 16/08/2012 04:40, Allen Wirfs-Brock a écrit : On Aug 15, 2012, at 5:09 PM, David Bruant wrote: Le 14/08/2012 04:16, Allen Wirfs-Brock a écrit : check out the current ES66 spec. draft. Based upon discussions at the March TC39 meeting hypot2 was eliminated and an optional third argument as

Re: Feedback on hypot and hypot2

2012-08-15 Thread David Bruant
Le 14/08/2012 04:16, Allen Wirfs-Brock a écrit : check out the current ES66 spec. draft. Based upon discussions at the March TC39 meeting hypot2 was eliminated and an optional third argument as added to hypot. Quoting relevant part of the March meeting notes [1]: Discussion of hypot, hypot2.

Re: Feedback on hypot and hypot2

2012-08-15 Thread Allen Wirfs-Brock
On Aug 15, 2012, at 5:09 PM, David Bruant wrote: Le 14/08/2012 04:16, Allen Wirfs-Brock a écrit : check out the current ES66 spec. draft. Based upon discussions at the March TC39 meeting hypot2 was eliminated and an optional third argument as added to hypot. Quoting relevant part of the

Re: Feedback on hypot and hypot2

2012-08-14 Thread Herby Vojčík
Hi, what about adding square and cube functions which accept any number of arguments and return sum of squares/cubes? For one arg, they would just return square/cube as expected, for more they will sum them (for none return 0 of course). Herby Allen Wirfs-Brock wrote: check out the

Re: Feedback on hypot and hypot2

2012-08-14 Thread Andrea Giammarchi
I think these things are really easy to implement and fast enough in current JS engines, e.g. function cube() { return cube.reduce.call(arguments, cube.iterator, 0); } cube.reduce = [].reduce; cube.iterator = function (p, c) { return p + Math.pow(c, 3); }; alert(cube(2, 3)); // 35 br On

Re: Feedback on hypot and hypot2

2012-08-14 Thread Jens Nockert
For reference, there is a proposal for a DSP-library[1] for the W3C Web Audio API, that would solve a very similar 'problem' in a browser, it also covers most of the use-cases for the other variadic `Math' functions that are proposed. function cube(sourceArray) { DSP.pow(tempArray,

Feedback on hypot and hypot2

2012-08-13 Thread David Bruant
Hi, I'd like to provide some feedback on the more math functions proposal [1] (and the most recent PDF at the top of the page) The hypot and hypot2 functions accept 2 or 3 arguments, but I don't see a reason why they wouldn't accept an unbounded number of arguments. Although the physical

Re: Feedback on hypot and hypot2

2012-08-13 Thread Christian Mayer
Am 13.08.2012 11:16, schrieb David Bruant: I'd like to talk about naming as well. hypot (for Hypotenuse) is an accurate name for the 2 dimension case, but much less for 3 dimensions as far as I know (the English wikipedia page [2] doesn't mention the 3D case either) and even less for

Re: Feedback on hypot and hypot2

2012-08-13 Thread David Bruant
Le 13/08/2012 19:56, Christian Mayer a écrit : Am 13.08.2012 11:16, schrieb David Bruant: I'd like to talk about naming as well. hypot (for Hypotenuse) is an accurate name for the 2 dimension case, but much less for 3 dimensions as far as I know (the English wikipedia page [2] doesn't mention

Re: Feedback on hypot and hypot2

2012-08-13 Thread Allen Wirfs-Brock
check out the current ES66 spec. draft. Based upon discussions at the March TC39 meeting hypot2 was eliminated and an optional third argument as added to hypot. Note that the new function names such as hypot are generally selected to match the names from widely used c libraries: