The collection of arithmetic operators includes the operators in the following categories:
Additive operator
Multiplicative operator
Postfix operator
Prefix operator
Applying some operators causes a strange degenerative effect in the accuracy. On the Macintosh in MSIE 5.0 and in Netscape 4, the following loop generates a very strange sequence of numbers that are quite erroneous:
for(myEnum = 1.5; myEnum > -2; myEnum -= 0.1)
{
document.write(myEnum + "<BR>");
}
There are some very odd and subtle mathematical errors in the arithmetic handling within the Macintosh platform, and it surely must be the platform since the same behavior is found on both MSIE and Netscape .
Prev | Home | Next |
Arithmetic constant | Up | Arithmetic type |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |