Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   JavaScript does make errors when dealing just with integers (http://www.velocityreviews.com/forums/t936851-javascript-does-make-errors-when-dealing-just-with-integers.html)

lorlarz 08-19-2008 07:00 PM

JavaScript does make errors when dealing just with integers
 
Contrary to what one authority in the JavaScript field says:
JavaScript does make errors when dealing with just with integers.

This authority (Douglas Crockford.) says:
"integer arithmetic in floating point [as JS uses] is exact"

Well, I can prove this is incorrect with this program:
http://mynichecomputing.com/digitallearning/yourOwn.htm

This a program that uses only integers, yet comes up short in its
addition or count
when used. HERE IS HOW TO DO THE EXPERIMENT AND SEE:

Without adding on an arbitrary decimal number less than one (I believe
I use .9) ,
this program will come up short in its count(addition).
So, omit that .9 from the program so the program is relying on the
pure exact
JavaScript addition. NOW, as a step 2: Set up the program
for "inventory scoring" by using some sample answers set using the
procedure
described for doing so for an inventory (see link on the web page I
gave you
the code for, for the directions) -- where an item may count on more
than
one scale and several items score each scale up (set up to do some of
each).
THEN: Use that scoring system
in several runs on sets of client answers (samples you also make
yourself)
and you will find the count coming up SHORT if you omit my + .9 from
the code.

You will find the count short. This would be disasterous in a voting
machine.




Joost Diepenmaat 08-19-2008 07:04 PM

Re: JavaScript does make errors when dealing just with integers
 
lorlarz <lorlarz@gmail.com> writes:

> Contrary to what one authority in the JavaScript field says:
> JavaScript does make errors when dealing with just with integers.
>
> This authority (Douglas Crockford.) says:
> "integer arithmetic in floating point [as JS uses] is exact"
>
> Well, I can prove this is incorrect with this program:
> http://mynichecomputing.com/digitallearning/yourOwn.htm
>
> This a program that uses only integers, yet comes up short in its
> addition or count
> when used. HERE IS HOW TO DO THE EXPERIMENT AND SEE:
>
> Without adding on an arbitrary decimal number less than one (I believe
> I use .9) ,
> this program will come up short in its count(addition).
> So, omit that .9 from the program so the program is relying on the
> pure exact
> JavaScript addition. NOW, as a step 2: Set up the program
> for "inventory scoring" by using some sample answers set using the
> procedure
> described for doing so for an inventory (see link on the web page I
> gave you
> the code for, for the directions) -- where an item may count on more
> than
> one scale and several items score each scale up (set up to do some of
> each).
> THEN: Use that scoring system
> in several runs on sets of client answers (samples you also make
> yourself)
> and you will find the count coming up SHORT if you omit my + .9 from
> the code.
>
> You will find the count short. This would be disasterous in a voting
> machine.



Just in case it escaped you: 0.9 is NOT an integer, so you are NOT
working with "just integers". We've done this to death.

See also:

http://docs.sun.com/source/806-3568/ncg_goldberg.html



--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

Stevo 08-19-2008 07:06 PM

Re: JavaScript does make errors when dealing just with integers
 
lorlarz wrote:
> Contrary to what one authority in the JavaScript field says:
> JavaScript does make errors when dealing with just with integers.
> I use .9) ,


Funny looking integer.

Gregor Kofler 08-19-2008 07:18 PM

Re: JavaScript does make errors when dealing just with integers
 
lorlarz meinte:

> This a program that uses only integers, yet comes up short in its
> addition or count
> when used. HERE IS HOW TO DO THE EXPERIMENT AND SEE:
> Without adding on an arbitrary decimal number less than one (I believe
> I use .9)


You're an idiot. Period. Hit the road!




--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum

lorlarz 08-19-2008 07:19 PM

Re: JavaScript does make errors when dealing just with integers
 
On Aug 19, 2:04*pm, Joost Diepenmaat <jo...@zeekat.nl> wrote:

>
> Just in case it escaped you: 0.9 is NOT an integer, so you are NOT
> working with "just integers". We've done this to death.
>


.9 IS A NEEDED CORRECTION FACTOR AND NOT IN THE PROGRAM THE WAY IT
**FAILS**.

The .9 is what has to be added to make the pure integer arithmetic
stop making
errors and coming up short. In the experiment, you take it OUT.

Once you remove the .9, all are integers and the math is supposed to
be exact,
and it is not.

lorlarz 08-19-2008 07:21 PM

Re: JavaScript does make errors when dealing just with integers
 
On Aug 19, 2:06*pm, Stevo <n...@mail.invalid> wrote:
> lorlarz wrote:
> > Contrary to what one authority in the JavaScript field says:
> > JavaScript does make errors when dealing with just with integers.
> > I use .9) ,

>
> Funny looking integer.


Will you jokers try to think and read carefully. You take the .9 OUT
to see the program fail. It succeeds with the .9 in there. IT IS A
CORRECTION
FACTOR THAT SUPPOSEDLY ID NOT NEEDED, BUT IT IS.

IT FAILS WHEN DOING PURE INTEGER ARITHMETIC WITHOUT THAT .9 Do the
experiment
and learn. To do the experiment you TAKE OUT THE .9

Joost Diepenmaat 08-19-2008 07:34 PM

Re: JavaScript does make errors when dealing just with integers
 
lorlarz <lorlarz@gmail.com> writes:

> On Aug 19, 2:04Â*pm, Joost Diepenmaat <jo...@zeekat.nl> wrote:
>
>>
>> Just in case it escaped you: 0.9 is NOT an integer, so you are NOT
>> working with "just integers". We've done this to death.
>>

>
> .9 IS A NEEDED CORRECTION FACTOR AND NOT IN THE PROGRAM THE WAY IT
> **FAILS**.
>
> The .9 is what has to be added to make the pure integer arithmetic
> stop making
> errors and coming up short. In the experiment, you take it OUT.
>
> Once you remove the .9, all are integers and the math is supposed to
> be exact,
> and it is not.


Well. how about you bloody well show us the code that demonstrates the
problem in a concise, well-formatted and clear way. Instead of, you
know, rambling on incoherently.

http://www.catb.org/~esr/faqs/smart-....html#id306810


--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

lorlarz 08-19-2008 07:37 PM

Re: JavaScript does make errors when dealing just with integers
 
On Aug 19, 2:18*pm, Gregor Kofler <use...@gregorkofler.at> wrote:
> lorlarz meinte:
>
> > This a program that uses only integers, yet comes up short in its
> > addition or count
> > when used. *HERE IS HOW TO DO THE EXPERIMENT AND SEE:
> > Without adding on an arbitrary decimal number less than one (I believe
> > I use .9)

>
> You're an idiot. Period. Hit the road!
>
> --http://photo.gregorkofler.at::: Landschafts- und Reisefotografiehttp://web.gregorkofler.com*::: meine JS-Spielwiesehttp://www.image2d.com* ** ::: Bildagentur für den alpinen Raum


No.

lorlarz 08-19-2008 07:40 PM

Re: JavaScript does make errors when dealing just with integers
 
On Aug 19, 2:18*pm, Gregor Kofler <use...@gregorkofler.at> wrote:
> lorlarz meinte:
>
> > This a program that uses only integers, yet comes up short in its
> > addition or count
> > when used. *HERE IS HOW TO DO THE EXPERIMENT AND SEE:
> > Without adding on an arbitrary decimal number less than one (I believe
> > I use .9)

>
> You're an idiot. Period. Hit the road!
>
> --http://photo.gregorkofler.at::: Landschafts- und Reisefotografiehttp://web.gregorkofler.com*::: meine JS-Spielwiesehttp://www.image2d.com* ** ::: Bildagentur für den alpinen Raum


Yours is a most unacceptable response to my revealing how authorities
it
the field of JavaScript ARE WRONG. You should be thanking me, before
your
bank account comes up short.

lorlarz 08-19-2008 07:44 PM

Re: JavaScript does make errors when dealing just with integers
 
On Aug 19, 2:34*pm, Joost Diepenmaat <jo...@zeekat.nl> wrote:
> lorlarz <lorl...@gmail.com> writes:
> > On Aug 19, 2:04*pm, Joost Diepenmaat <jo...@zeekat.nl> wrote:

>
> >> Just in case it escaped you: 0.9 is NOT an integer, so you are NOT
> >> working with "just integers". We've done this to death.

>
> > .9 IS A NEEDED CORRECTION FACTOR AND NOT IN THE PROGRAM THE WAY IT
> > **FAILS**.

>
> > The .9 is what has to be added to make the pure integer arithmetic
> > stop making
> > errors and coming up short. In the experiment, you take it OUT.

>
> > Once you remove the .9, all are integers and the math is supposed to
> > be exact,
> > and it is not.

>
> Well. how about you bloody well show us the code that demonstrates the
> problem in a concise, well-formatted and clear way. Instead of, you
> know, rambling on incoherently.
>
> http://www.catb.org/~esr/faqs/smart-....html#id306810
>
> --
> Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/- Hide quoted text -
>
> - Show quoted text -


Well, its 100% all mine and I take full responsibility. In contrast:
What team of
script kiddie monkeys did you work with for your ajax fiasco?


All times are GMT. The time now is 06:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.