Re: ES Decimal status

2008-09-25 Thread waldemar
> I believe that we have a solution that everybody might not find ideal, > but hopefully can live with, which I will outline below with examples: > > typeof(1m) === "decimal" > 1.1m === 1.10m > (1.10m).toString() === "1.10" > (1e+3m).toString() === "1000" > > Additionally, there will be another met

Re: ES Decimal status

2008-09-25 Thread Sam Ruby
On Thu, Sep 25, 2008 at 10:24 AM, Mike Cowlishaw <[EMAIL PROTECTED]> wrote: > > OK, and also liorean says: >> I'm of the opinion that decimal128 and binary64 should behave >> identically in as many areas as possible. > > That's a valid model. I suppose I see strings and decimals as being > 'closer

Re: ES Decimal status

2008-09-25 Thread Mike Cowlishaw
[Was on airplanes since my last post, arrived late in SeaTac ... will try and consoliate replies on this thread to one e-mail :-)] > >> I'm not sure what you are getting at. a[1] and a[1.000] refer to the > >> same property in ECMAScript, but a[1m] and a[1.000m] would not. Are > >> you saying th

Re: ES Decimal Status

2008-09-24 Thread Garrett Smith
2008/9/24 Maciej Stachowiak <[EMAIL PROTECTED]>: > > On Sep 24, 2008, at 8:41 AM, Michael wrote: > > Maciej wrote: > > "I'm not sure what you are getting at. a[1] and a[1.000] refer to the > > same property in ECMAScript, but a[1m] and a[1.000m] would not. Are > you saying this isn't a problem?" >

RE: ES Decimal Status

2008-09-24 Thread Michael
: es-discuss@mozilla.org Subject: Re: ES Decimal Status On Sep 24, 2008, at 8:41 AM, Michael wrote: Maciej wrote: "I'm not sure what you are getting at. a[1] and a[1.000] refer to the same property in ECMAScript, but a[1m] and a[1.000m] would not. Are you saying this isn&#

Re: ES Decimal status

2008-09-24 Thread waldemar
> This is, no doubt, because if one is treating array indexes as a set of > integers you use integer operations on those indexes (almost exclusively > +, -, and *). Mike; The claim that using only integers and only multiplication will save array indexing is false. Under your current proposal exa

Re: ES Decimal status

2008-09-24 Thread Sam Ruby
Brendan Eich wrote: > > This a === b => o[a] is o[b] invariant (ignore the tiny number > exceptions; I agree they're undesirable spec bugs) is what folks on > the list are concerned about breaking, for integral values. > Fractional index values and strings consisting of numeric literals >

Re: ES Decimal status

2008-09-24 Thread Brendan Eich
On Sep 24, 2008, at 9:18 AM, Sam Ruby wrote: [over-top-citing trimmed] The concern remains, though. Not due to power-of-five problems that would lead to 0.09987 or the like, but from cases where a number was spelled with extra trailing zeros (in external data, e.g. a spreadsheet)

Re: ES Decimal status

2008-09-24 Thread Brendan Eich
On Sep 24, 2008, at 9:17 AM, Brendan Eich wrote: > On Sep 24, 2008, at 9:01 AM, Mike Cowlishaw wrote: >> Absolutely not a problem ... many languages (and ES itself) which >> index >> 'arrays' by strings treat the index "1.000" as different from "1", >> and >> this is not considered a problem. >

Re: ES Decimal status

2008-09-24 Thread Maciej Stachowiak
On Sep 24, 2008, at 9:01 AM, Mike Cowlishaw wrote: > >> I would agree with Waldermar that it is a serious problem. Not so >> much >> for literals as for values that end up with varying numbers of >> trailing zeroes depending on how they were computed, even though they >> are numerically the same

Re: ES Decimal status

2008-09-24 Thread Sam Ruby
Brendan Eich wrote: > On Sep 24, 2008, at 8:28 AM, Sam Ruby wrote: > My apologies. That wasn't the question I was intending. Can you identify code that today depends on numeric binary 64 floating point which makes use of operations such as unrounded division and depends o

Re: ES Decimal status

2008-09-24 Thread Brendan Eich
On Sep 24, 2008, at 9:01 AM, Mike Cowlishaw wrote: >> I'm not sure what you are getting at. a[1] and a[1.000] refer to the >> same property in ECMAScript, but a[1m] and a[1.000m] would not. Are >> you saying this isn't a problem? > > Absolutely not a problem ... many languages (and ES itself) whic

Re: ES Decimal Status

2008-09-24 Thread liorean
> Maciej wrote: > "I'm not sure what you are getting at. a[1] and a[1.000] refer to the > same property in ECMAScript, but a[1m] and a[1.000m] would not. Are > you saying this isn't a problem?" I would say this is indeed a problem. I'm of the opinion that decimal128 and binary64 should behave iden

Re: ES Decimal status

2008-09-24 Thread Mike Cowlishaw
> >> and in particular they don't call it on the index in an array > >> indexing > >> operation. > > > > This is true. But that in itself is not the problem. Currently, > > should a > > programmer write: > > > > a[1]="first" > > a[1.000]="second" > > > > it's assumed that the second case was

Re: ES Decimal Status

2008-09-24 Thread Brendan Eich
On Sep 24, 2008, at 8:41 AM, Michael wrote: Maciej wrote: “I'm not sure what you are getting at. a[1] and a[1.000] refer to the same property in ECMAScript, but a[1m] and a[1.000m] would not. Are you saying this isn't a problem?” This is not quite true as you can see here: var a = []; a[1]

Re: ES Decimal status

2008-09-24 Thread Maciej Stachowiak
On Sep 24, 2008, at 8:28 AM, Sam Ruby wrote: >>> >>> My apologies. That wasn't the question I was intending. >>> >>> Can you identify code that today depends on numeric binary 64 >>> floating >>> point which makes use of operations such as unrounded division and >>> depends on trailing zeros b

Re: ES Decimal status

2008-09-24 Thread Brendan Eich
On Sep 24, 2008, at 8:28 AM, Sam Ruby wrote: >>> My apologies. That wasn't the question I was intending. >>> >>> Can you identify code that today depends on numeric binary 64 >>> floating >>> point which makes use of operations such as unrounded division and >>> depends on trailing zeros being

Re: ES Decimal Status

2008-09-24 Thread Maciej Stachowiak
On Sep 24, 2008, at 8:41 AM, Michael wrote: Maciej wrote: “I'm not sure what you are getting at. a[1] and a[1.000] refer to the same property in ECMAScript, but a[1m] and a[1.000m] would not. Are you saying this isn't a problem?” This is not quite true as you can see here: var a = []; a[1] =

ES Decimal Status

2008-09-24 Thread Michael
Maciej wrote: "I'm not sure what you are getting at. a[1] and a[1.000] refer to the same property in ECMAScript, but a[1m] and a[1.000m] would not. Are you saying this isn't a problem?" This is not quite true as you can see here: var a = []; a[1] = "foo"; a[1.00] = "bar"; WScri

Re: ES Decimal status

2008-09-24 Thread Sam Ruby
Maciej Stachowiak wrote: > > You probably meant to send this to the list. Oops. Resending. Thanks! > - Maciej > > On Sep 24, 2008, at 8:17 AM, Sam Ruby wrote: > >> On Wed, Sep 24, 2008 at 10:45 AM, Maciej Stachowiak <[EMAIL PROTECTED]> >> wrote: >>> >>> On Sep 24, 2008, at 7:31 AM, Sam Rub

Re: ES Decimal status

2008-09-24 Thread Maciej Stachowiak
On Sep 24, 2008, at 7:31 AM, Sam Ruby wrote: > Maciej Stachowiak wrote: >> On Sep 24, 2008, at 3:33 AM, Mike Cowlishaw wrote: and in particular they don't call it on the index in an array indexing operation. >>> This is true. But that in itself is not the problem. Currently,

Re: ES Decimal status

2008-09-24 Thread Sam Ruby
Maciej Stachowiak wrote: > On Sep 24, 2008, at 3:33 AM, Mike Cowlishaw wrote: > >>> and in particular they don't call it on the index in an array >>> indexing >>> operation. >> This is true. But that in itself is not the problem. Currently, >> should a >> programmer write: >> >> a[1]="first

Re: ES Decimal status

2008-09-24 Thread Maciej Stachowiak
On Sep 24, 2008, at 3:33 AM, Mike Cowlishaw wrote: >> and in particular they don't call it on the index in an array >> indexing >> operation. > > This is true. But that in itself is not the problem. Currently, > should a > programmer write: > > a[1]="first" > a[1.000]="second" > > it's as

Re: ES Decimal status

2008-09-24 Thread Mike Cowlishaw
David-Sarah Hopwood wrote: > Mike Cowlishaw wrote: > >> Waldemar Horwat wrote: > >>> Mike Cowlishaw wrote: > > There is still a blocking issue that's been discussed a lot but left > > off the issues here: > > > > - Treatment of cohorts in the default conversion of decimal to > >>>

Re: ES Decimal status

2008-09-23 Thread David-Sarah Hopwood
Mike Cowlishaw wrote: >> Waldemar Horwat wrote: >>> Mike Cowlishaw wrote: > There is still a blocking issue that's been discussed a lot but left > off the issues here: > > - Treatment of cohorts in the default conversion of decimal to > string. [...] I'm still not cle

Re: ES Decimal status

2008-09-23 Thread David-Sarah Hopwood
Waldemar Horwat wrote: > Mike Cowlishaw wrote: >>> There is still a blocking issue that's been discussed a lot but left >>> off the issues here: >>> >>> - Treatment of cohorts in the default conversion of decimal to >>> string. Despite objections, I still get the following results: >>> >>> 1/3m -

Re: ES Decimal status

2008-09-23 Thread Waldemar Horwat
Mike Cowlishaw wrote: >> There is still a blocking issue that's been discussed a lot but left >> off the issues here: >> >> - Treatment of cohorts in the default conversion of decimal to >> string. Despite objections, I still get the following results: >> >> 1/3m - 1/3m produces 0e-34 >> >> 1e12m

Re: ES Decimal status

2008-09-23 Thread Mike Cowlishaw
> There is still a blocking issue that's been discussed a lot but left > off the issues here: > > - Treatment of cohorts in the default conversion of decimal to > string. Despite objections, I still get the following results: > > 1/3m - 1/3m produces 0e-34 > > 1e12m - 1e12m produces 0e+12 > >

Re: ES Decimal status

2008-09-22 Thread Waldemar Horwat
There is still a blocking issue that's been discussed a lot but left off the issues here: - Treatment of cohorts in the default conversion of decimal to string. Despite objections, I still get the following results: 1/3m - 1/3m produces 0e-34 1e12m - 1e12m produces 0e+12 1/.1m produces 1e+1

Re: ES Decimal status

2008-09-12 Thread Mike Cowlishaw
> Conversion from number to decimal is precise and will round trip. > >>> Conversion of number to decimal is not precise. > >> I chose my words carefully :-) > >> http://en.wikipedia.org/wiki/Accuracy_and_precision > > > > I agree that decimal has a precision greater than number, but you

Re: ES Decimal status

2008-09-12 Thread Sam Ruby
On Fri, Sep 12, 2008 at 7:01 PM, David-Sarah Hopwood <[EMAIL PROTECTED]> wrote: > Sam Ruby wrote: >> On Fri, Sep 12, 2008 at 4:02 PM, David-Sarah Hopwood >> <[EMAIL PROTECTED]> wrote: >>> Sam Ruby wrote: Description of ES 3.1m decimal support number and decimal are distinct prim

Re: ES Decimal status

2008-09-12 Thread David-Sarah Hopwood
Sam Ruby wrote: > On Fri, Sep 12, 2008 at 4:02 PM, David-Sarah Hopwood > <[EMAIL PROTECTED]> wrote: >> Sam Ruby wrote: >>> Description of ES 3.1m decimal support >>> >>> number and decimal are distinct primitive data types. The >>> former is based on IEEE 754 binary 64 floating point, th

Re: ES Decimal status

2008-09-12 Thread David-Sarah Hopwood
Sam Ruby wrote: > Description of ES 3.1m decimal support > > number and decimal are distinct primitive data types. The > former is based on IEEE 754 binary 64 floating point, the latter > is based on IEEE 754r decimal 128 floating point. [...] > Conversion from number to decim

ES Decimal status

2008-09-12 Thread Sam Ruby
Preface: Poor Pratap. He's folded in updates from me on the various operators several times now. It has gone from Type(Result(n)) is Decimal, to Form(Result(n)) is Decimal, and now reads Result(n) instanceof Decimal. I believe that the current consensus is that the orig