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.