Re: Re: Re: Math.sign vs ±0

2013-11-04 Thread Rick Waldron
On Mon, Nov 4, 2013 at 4:10 AM, Ingvar Stepanyan m...@rreverser.com wrote: Why can’t we do Uint64 class inside Math namespace to be used for all the 64-bit arithmetic operations? Like: var x = Math.Uint64(2); var y = Math.Uint64.fromString(“0x12345678abcdef01”); var z = x.mul(y); // or

RE: Re: Re: Math.sign vs ±0

2013-11-04 Thread Ingvar Stepanyan
That's strange. I believe I replied to different thread. Sorry. Sent from my Windows Phone From: Rick Waldron Sent: 04.11.2013 15:41 To: Ingvar Stepanyan Cc: es-discuss@mozilla.org Subject: Re: Re: Re: Math.sign vs ±0 On Mon, Nov 4, 2013 at 4:10 AM, Ingvar

Re: Re: Math.sign vs ±0

2013-11-04 Thread Brendan Eich
There's no particular reason not to do something like that, except: 1. It is not usable (see http://www.jroller.com/cpurdy/entry/the_seven_habits_of_highly1%23comment-1130764636000). 2. Math is becoming a dumping ground, as noted up-thread. 3. Polyfillability is not important if old code can

Re: Math.sign vs ±0

2013-10-30 Thread Claude Pache
Le 30 oct. 2013 à 04:54, Oliver Hunt oli...@apple.com a écrit : As currently specified Math.sign has 5 different return values and, as far as i can tell, does not solve the problem I thought it was trying to address. That is the difficulty in distinguishing positive and negative numbers

Re: Math.sign vs ±0

2013-10-30 Thread Claude Pache
Le 30 oct. 2013 à 11:44, K. Gadd k...@luminance.org a écrit : Unfortunately Claude, ES Math.sign is not Signum; it has five outputs, not three, like Oliver was asking about. Observe: Math.sign(1 / 0) 1 Math.sign(-1 / 0) -1 Math.sign(-1 / 0 * 0) NaN Math.sign(0 * -1) -0

RE: Math.sign vs ±0

2013-10-30 Thread Nathan Wall
Claude Pache wrote: `Math.sign` is expected to represent the mathematical sign function, which has a precise definition, see [1], [2]. Please note that `+0` and `-0` are the same value as far as maths is concerned, and that value is neither positive nor negative. (Or both nonnegative and

RE: Math.sign vs ±0

2013-10-30 Thread Nathan Wall
Nathan Wall wrote: At the very least, I think Oliver has a point in that it'd be very useful to have a sign function which would return 1 for +0 and -1 for -0. I've needed this in the past. If it shouldn't be `Math.sign`, perhaps there should be a `Number.sign` which would match the other

Re: Math.sign vs ±0

2013-10-30 Thread Allen Wirfs-Brock
On Oct 29, 2013, at 8:54 PM, Oliver Hunt wrote: As currently specified Math.sign has 5 different return values and, as far as i can tell, does not solve the problem I thought it was trying to address. That is the difficulty in distinguishing positive and negative numbers without having to