Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 13th, 2008, 11:45 PM
Dr J R Stockton
Guest
 
Posts: n/a
Default Re: comp.lang.javascript FAQ - Quick Answers 2008-10-13

In comp.lang.javascript message <48f30006$0$90271$14726298@news.sunsite.
dk>, Mon, 13 Oct 2008 08:00:02, FAQ server <javascript@dotinternet.be>
posted:
Quote:
>
>
4.2 _Why does simple decimal arithmetic give strange results_?
>
Otherwise, use Math.round on the results of expressions which
should be of integer value.
Does not answer the question.
None of those is both completely accurate and user-friendly. In
particular, unless there is no alternative, anything that has any hint
of implying that the RESULT has a variable radix should not be cited.

Is the posting process having difficulties with the input provided?

--
(c) John Stockton, near London. *@merlyn.demon.co.uk/?.?.Stockton@physics.org
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Correct <= 4-line sig. separator as above, a line precisely "-- " (SoRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SoRFC1036)
  #2  
Old October 14th, 2008, 01:15 AM
dhtml
Guest
 
Posts: n/a
Default Re: comp.lang.javascript FAQ - Quick Answers 2008-10-13

Dr J R Stockton wrote:
Quote:
In comp.lang.javascript message <48f30006$0$90271$14726298@news.sunsite.
dk>, Mon, 13 Oct 2008 08:00:02, FAQ server <javascript@dotinternet.be>
posted:
Quote:
>>
>4.2 _Why does simple decimal arithmetic give strange results_?
>>
>Otherwise, use Math.round on the results of expressions which
>should be of integer value.
>
Does not answer the question.
>
In some cases it might solve a problem. For example:

..3 + .6 + .1;
=0.9999999999999999

Math.round(.3 + .6 + .1);
= 1
Quote:
>
None of those is both completely accurate and user-friendly. In
particular, unless there is no alternative, anything that has any hint
of implying that the RESULT has a variable radix should not be cited.
>
Is the posting process having difficulties with the input provided?
>
They all have good examples on them. The one on mozilla.org could have a
few more.

parseInt("F", 16);
parseInt("0xF", 16);
parseInt("17", 8);
parseInt("15", 10);
parseInt(15.99, 10);
parseInt("FXX123", 16);
parseInt("1111", 2);
parseInt("15*3", 10);
parseInt("12", 13);

The answer can't be both short and include a full discussion. I'm going
to add some more examples to the mozilla.org page, which is linked.

Garrett

--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >
  #3  
Old October 14th, 2008, 11:45 PM
Dr J R Stockton
Guest
 
Posts: n/a
Default Re: comp.lang.javascript FAQ - Quick Answers 2008-10-13

In comp.lang.javascript message <gd0o2j$7o2$1@registered.motzarella.org>
, Mon, 13 Oct 2008 17:10:58, dhtml <dhtmlkitchen@gmail.composted:
Quote:
>Dr J R Stockton wrote:
Quote:
>In comp.lang.javascript message <48f30006$0$90271$14726298@news.sunsite.
>dk>, Mon, 13 Oct 2008 08:00:02, FAQ server <javascript@dotinternet.be>
>posted:
Quote:
>>>
>>4.2 _Why does simple decimal arithmetic give strange results_?
>>>
>>Otherwise, use Math.round on the results of expressions which
>>should be of integer value.
> Does not answer the question.
>>
>
>In some cases it might solve a problem. For example:
>
>.3 + .6 + .1;
>=0.9999999999999999
>
>Math.round(.3 + .6 + .1);
>= 1
Yes. But it does not answer the question. If a FAQ heading is a
question, that question needs to be answered. Otherwise, change the
heading so that it matches the answer. That answers "I get strange
results; what might fix that?".

The text which appears in the HTML FAQ, but not in the first Article
with the current Subject, does answer the question. In that Article,
4.3 was also gutted.


Quote:
Quote:
> None of those is both completely accurate and user-friendly. In
>particular, unless there is no alternative, anything that has any hint
>of implying that the RESULT has a variable radix should not be cited.
> Is the posting process having difficulties with the input provided?
>>
>
>They all have good examples on them. The one on mozilla.org could have
>a few more.
>
>parseInt("F", 16);
>parseInt("0xF", 16);
>parseInt("17", 8);
>parseInt("15", 10);
>parseInt(15.99, 10);
>parseInt("FXX123", 16);
>parseInt("1111", 2);
>parseInt("15*3", 10);
>parseInt("12", 13);
>
>The answer can't be both short and include a full discussion. I'm going
>to add some more examples to the mozilla.org page, which is linked.

When deciding to make a citation, one should give much weight to where
it is wrong or misleading. A reference page should be almost perfect,
technically. Examples can always be put elsewhere.





There could be a new FAQ Note, headed "Parts Removed from the FAQ as not
being useful enough, but having some possible residual value".

There could be a new FAQ Note, headed "Examples for FAQ". A FAQ entry
such as that for parseInt could have a link shown as Examples pointing
to an anchor on that new page. On that page (splittable if needed) one
can be more liberal with examples than is appropriate for News.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zipTimo Salmi's Turbo Pascal FAQ.
  #4  
Old October 15th, 2008, 06:15 AM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: comp.lang.javascript FAQ - Quick Answers 2008-10-13

Dr J R Stockton wrote:
Quote:
FAQ server posted:
Quote:
Quote:
>4.3 _Why does K = parseInt('09') set K to 0_?
>>
>><URL:http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_...>
>* <URL:http://msdn2.microsoft.com/en-us/library/x53yedee.aspx>
>* <URL:http://docs.sun.com/source/816-6408-10/toplev.htm#1064173>
>* <URL:http://www.jibbering.com/faq/faq_notes/faq_notes.html#FAQN4_12>
>
None of those is both completely accurate and user-friendly. *In
particular, unless there is no alternative, anything that has any hint
of implying that the RESULT has a variable radix should not be cited.
>
Is the posting process having difficulties with the input provided?
"comp.lang.javascript FAQ - Quick Answers" is posted every Monday and
uses the following file to send:

http://jibbering.com/faq/index.mon.txt

The daily FAQ entries are sent from the following XML input:

http://www.jibbering.com/faq/index.xml

Indeed, 4.3. appears to be different in the two files.

--
Bart
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles