Re: Thoughts on IEEE P754

2008-09-03 Thread David-Sarah Hopwood
Maciej Stachowiak wrote: > On Aug 22, 2008, at 2:46 PM, Mark S. Miller wrote: > >> Finally, I'd like to take a poll: Other than people working on decimal >> at IBM and people on the EcmaScript committee, is there anyone on this >> list who thinks that decimal adds significant value to EcmaScript?

Re: Thoughts on IEEE P754

2008-08-25 Thread Steven Johnson
FWIW, ByteArray has been immensely popular (and useful) in ActionScript 3. I would hope it can make it into both 3.1 and Harmony. (ByteVector is probably a better name, though, as its behavior is more Vector-like than Array-like.) On 8/23/08 6:49 PM, "Brendan Eich" <[EMAIL PROTECTED]> wrote: >

Re: Thoughts on IEEE P754

2008-08-23 Thread Brendan Eich
On Aug 23, 2008, at 6:49 PM, Brendan Eich wrote: >> Finally, while Decimal seems like it will be useful to knowledgeable >> developers dealing with financial data, it seems likely to confuse >> the >> average developer more than it will help. > > That is unclear. A "use decimal" pragma that does

Re: Thoughts on IEEE P754

2008-08-23 Thread Brendan Eich
On Aug 23, 2008, at 2:07 AM, Maciej Stachowiak wrote: To my view, Decimal is much less important overall than, say, ByteArray or some other effective way to represent binary data, which is not in ES3.1 and was even rejected from ES4 (at least as then spec'd). Just for the record, ByteArray was

Re: Thoughts on IEEE P754

2008-08-23 Thread Maciej Stachowiak
On Aug 23, 2008, at 6:54 AM, Mike Cowlishaw wrote: >> Maciej Stachowiak <[EMAIL PROTECTED]> wrote: >> >>> Finally, I'd like to take a poll: Other than people working on >>> decimal >>> at IBM and people on the EcmaScript committee, is there anyone on >>> this >>> list who thinks that decimal

Re: Thoughts on IEEE P754

2008-08-23 Thread Mike Cowlishaw
> Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > > Finally, I'd like to take a poll: Other than people working on decimal > > at IBM and people on the EcmaScript committee, is there anyone on this > > list who thinks that decimal adds significant value to EcmaScript? If > > so, please speak up. T

Re: Thoughts on IEEE P754

2008-08-23 Thread Breton Slivka
On Sat, Aug 23, 2008 at 7:08 PM, David Jones <[EMAIL PROTECTED]> wrote: > > On 22 Aug 2008, at 22:46, Mark S. Miller wrote: >> >> Finally, I'd like to take a poll: Other than people working on decimal >> at IBM and people on the EcmaScript committee, is there anyone on this >> list who thinks that

Re: Thoughts on IEEE P754

2008-08-23 Thread David Jones
On 22 Aug 2008, at 22:46, Mark S. Miller wrote: > > Finally, I'd like to take a poll: Other than people working on decimal > at IBM and people on the EcmaScript committee, is there anyone on this > list who thinks that decimal adds significant value to EcmaScript? If > so, please speak up. Thanks.

Re: Thoughts on IEEE P754

2008-08-23 Thread Maciej Stachowiak
On Aug 22, 2008, at 2:46 PM, Mark S. Miller wrote: > Finally, I'd like to take a poll: Other than people working on decimal > at IBM and people on the EcmaScript committee, is there anyone on this > list who thinks that decimal adds significant value to EcmaScript? If > so, please speak up. Thank

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > On Fri, Aug 22, 2008 at 7:07 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> I find it easier to talk about real examples than abstractions. I've >>> done the following quickly, so forgive me if I get some detail wrong. >>> >>> A binary floating point number

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 7:07 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> I find it easier to talk about real examples than abstractions. I've >> done the following quickly, so forgive me if I get some detail wrong. >> >> A binary floating point number has 52 bits of fractio

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > I find it easier to talk about real examples than abstractions. I've > done the following quickly, so forgive me if I get some detail wrong. > > A binary floating point number has 52 bits of fraction, and by > assuming an implicit leading one, they get an additional bit. This >

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: >>> Now we've gone full circle without actually answering the question I asked: >>> What should the full result of converting 1.1 to a Decimal be in >>> ECMAScript? >>> >>> "An error" or "you can't do it" is not a valid answer because it violates >>> IEEE P754. >> I'm clearly no

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
Oops, forgot to copy the list On Fri, Aug 22, 2008 at 6:54 PM, Sam Ruby <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 6:02 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> On Fri, Aug 22, 2008 at 5:06 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: Sam Ruby wrote: >

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 5:46 PM, Mark S. Miller <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 11:39 AM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> When dealing with currency, having 0.05 + 0.05 produce 0.10 is a feature. >> >> Contrary to some beliefs, the different co

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > On Fri, Aug 22, 2008 at 5:06 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> On Fri, Aug 22, 2008 at 4:18 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: Sam Ruby wrote: > On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> > wro

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 5:06 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> On Fri, Aug 22, 2008 at 4:18 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >>> Sam Ruby wrote: On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Here's a question f

Re: Thoughts on IEEE P754

2008-08-22 Thread Mark S. Miller
On Fri, Aug 22, 2008 at 11:39 AM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> When dealing with currency, having 0.05 + 0.05 produce 0.10 is a feature. > > Contrary to some beliefs, the different cohort members in IEEE P754 are *not* > a valid indicator of precision. To prove

Re: Thoughts on IEEE P754

2008-08-22 Thread David Jones
On 22 Aug 2008, at 20:42, David-Sarah Hopwood wrote: > David Jones wrote: >> On 22 Aug 2008, at 19:28, David-Sarah Hopwood wrote: >>> Two values that are === should index the same property [*]. >> >>> [*] but not conversely: two values that index the same property are >>> not necessarily ===

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > On Fri, Aug 22, 2008 at 4:18 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: Here's a question for you: What should the full result of converting 1.1 to a Decimal be in

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 4:18 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > >>> Here's a question for you: >>> >>> What should the full result of converting 1.1 to a Decimal be in >>> ECMAScript? De

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> On Fri, Aug 22, 2008 at 2:28 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: Sam Ruby wrote: > Waldemar Horwat wrote: >> Some tidbits about our embedding of decimal:

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 3:55 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> On Fri, Aug 22, 2008 at 2:28 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >>> Sam Ruby wrote: Waldemar Horwat wrote: > Some tidbits about our embedding of decimal: > > - Contagion sho

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > On Fri, Aug 22, 2008 at 2:28 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> Waldemar Horwat wrote: Some tidbits about our embedding of decimal: - Contagion should be towards decimal if decimal and binary are mixed as operands. 5.3m + 1 s

Re: Thoughts on IEEE P754

2008-08-22 Thread David-Sarah Hopwood
David-Sarah Hopwood wrote: > One can argue about the merits or otherwise of scale preservation, but > it's an intentional property of the P754 decimal floating point design. > See section 2 of > > for the arguments in favour (which I'm no

Re: Thoughts on IEEE P754

2008-08-22 Thread David-Sarah Hopwood
David Jones wrote: > On 22 Aug 2008, at 19:28, David-Sarah Hopwood wrote: >> Two values that are === should index the same property [*]. > >> [*] but not conversely: two values that index the same property are >> not necessarily ===. > > That highly desirable, but not true, as my earlier mes

Re: Thoughts on IEEE P754

2008-08-22 Thread Mike Cowlishaw
> Mike Cowlishaw wrote: > > Seems to me the problem here is not decimal (or binary) representations > > but arrays (consider a(0.0) and a("0.0")). > > > > In effect the array definition in ES3 says -- in a rather roundabout way > > -- that all indexes must be an integer (which fits in 32 bits

Re: Thoughts on IEEE P754

2008-08-22 Thread David Jones
On 22 Aug 2008, at 19:28, David-Sarah Hopwood wrote: > Jason Orendorff wrote: >> On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> >> wrote: >>> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >>> <[EMAIL PROTECTED]> wrote: var a = []; a[0] = "first"; a[0.0m] = "s

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
David-Sarah Hopwood wrote: > Jason Orendorff wrote: >> On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> wrote: >>> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >>> <[EMAIL PROTECTED]> wrote: var a = []; a[0] = "first"; a[0.0m] = "second"; // a second property? >

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 2:28 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> Waldemar Horwat wrote: >>> >>> Some tidbits about our embedding of decimal: >>> >>> - Contagion should be towards decimal if decimal and binary are mixed >>> as operands. 5.3m + 1 should be 6.3m, not 6

Re: Thoughts on IEEE P754

2008-08-22 Thread David-Sarah Hopwood
Mike Cowlishaw wrote: > In effect the array definition in ES3 says -- in a rather roundabout way > -- that all indexes must be an integer (which fits in 32 bits if encoded > in binary). No, arrays can have arbitrary properties, and there are no additional coercions when a property is accessed on

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: >> - We should not print the trailing zeroes. IEEE P754 does not >> require it, and it breaks things such as array lookup. There is >> precedence for this in ECMAScript: -0 and +0 both print as "0". If >> someone really wants to distinguish among equal numbers, he can do it >> w

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Sam Ruby wrote: > Waldemar Horwat wrote: >> >> Some tidbits about our embedding of decimal: >> >> - Contagion should be towards decimal if decimal and binary are mixed >> as operands. 5.3m + 1 should be 6.3m, not 6.3. If we use 128-bit >> decimal, this also makes the behavior of heterogeneous com

Re: Thoughts on IEEE P754

2008-08-22 Thread David-Sarah Hopwood
Jason Orendorff wrote: > On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> wrote: >> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >> <[EMAIL PROTECTED]> wrote: >>> var a = []; >>> a[0] = "first"; >>> a[0.0m] = "second"; // a second property? >>> a[0.000m] = "third"; // a thi

Re: Thoughts on IEEE P754

2008-08-22 Thread Waldemar Horwat
Mike Cowlishaw wrote: > Seems to me the problem here is not decimal (or binary) representations > but arrays (consider a(0.0) and a("0.0")). > > In effect the array definition in ES3 says -- in a rather roundabout way > -- that all indexes must be an integer (which fits in 32 bits if encoded >

Re: Thoughts on IEEE P754

2008-08-22 Thread David Jones
On 22 Aug 2008, at 15:22, Jason Orendorff wrote: > On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> > wrote: >> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >> <[EMAIL PROTECTED]> wrote: >>> var a = []; >>> a[0] = "first"; >>> a[0.0m] = "second"; // a second property? >>>

Re: Thoughts on IEEE P754

2008-08-22 Thread Mike Cowlishaw
> >> var a = []; > >> a[0] = "first"; > >> a[0.0m] = "second"; // a second property? > >> a[0.000m] = "third"; // a third? > > > > [...] > > > > It seems to me that if trailing zeros are retained in a call to > > ToString, then to be consistent with ES3, the three assignments above > > woul

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
Jason Orendorff wrote: > On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> wrote: >> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >> <[EMAIL PROTECTED]> wrote: >>> var a = []; >>> a[0] = "first"; >>> a[0.0m] = "second"; // a second property? >>> a[0.000m] = "third"; // a thi

Re: Thoughts on IEEE P754

2008-08-22 Thread Jason Orendorff
On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff > <[EMAIL PROTECTED]> wrote: >> var a = []; >> a[0] = "first"; >> a[0.0m] = "second"; // a second property? >> a[0.000m] = "third"; // a third? > > [...] > > It seems to m

Re: Thoughts on IEEE P754

2008-08-22 Thread Sam Ruby
On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff <[EMAIL PROTECTED]> wrote: > On Thu, Aug 21, 2008 at 9:08 PM, Sam Ruby <[EMAIL PROTECTED]> wrote: >> Waldemar Horwat wrote: >>> - We should not print the trailing zeroes. IEEE P754 does not >>> require it, and it breaks things such as array lookup.

Re: Thoughts on IEEE P754

2008-08-22 Thread Mike Cowlishaw
Waldemar wrote: > I just had some time to spend reading the proposed draft of the new > floating point spec. It quickly became apparent that ES3.1 is far > out of conformance with that draft and it would be a significant > undertaking to update it to conform to the new standard. In > additi

Re: Thoughts on IEEE P754

2008-08-21 Thread Jason Orendorff
On Thu, Aug 21, 2008 at 9:08 PM, Sam Ruby <[EMAIL PROTECTED]> wrote: > Waldemar Horwat wrote: >> - We should not print the trailing zeroes. IEEE P754 does not >> require it, and it breaks things such as array lookup. There is >> precedence for this in ECMAScript: -0 and +0 both print as "0". If

Re: Thoughts on IEEE P754

2008-08-21 Thread Sam Ruby
Waldemar Horwat wrote: > > Some tidbits about our embedding of decimal: > > - Contagion should be towards decimal if decimal and binary are mixed > as operands. 5.3m + 1 should be 6.3m, not 6.3. If we use 128-bit > decimal, this also makes the behavior of heterogeneous comparisons > (binary com

Thoughts on IEEE P754

2008-08-21 Thread Waldemar Horwat
I just had some time to spend reading the proposed draft of the new floating point spec. It quickly became apparent that ES3.1 is far out of conformance with that draft and it would be a significant undertaking to update it to conform to the new standard. In addition, doing so would introduce