Reply to Re: Display of large numbers

Your name:

Reply:


Posted by cwdjrxyz on 02/01/06 18:49

Cogito wrote:
> I am using a javascript function to generates large numbers. It
> appears that when the number exceeds 20 digits it is displayed in
> scientific notation, that is, a base and an exponent. Is there a way
> to avoid this and display the complete number instead?

One thing to keep in mind is that JS can handle only 20+ digits, so any
numbers too small or too large to be held within this limit must be
truncated, rounded off, or expressed in scientific notation. Also, be
aware that if you are working with everyday base 10 calculations,
calculations made on digital computers are done in a base 2, or
multiples thereof, number system - binary, octal, hex, etc. If you
calculate using decimal fractions such as in dollars and cents, a
result that should be $2, for example might be given as 1.999999999999
because some numbers used in a calculation can not be represented
exactly in either a base 10 or base 2 number system. You likely can
find more information about this in the FAQs at the Usenet group
comp.lang.javascript, where a link to the FAQs usually is posted every
few days.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация