Microsoft KB Archive/127745

= Microsoft Knowledge Base =

MXL5: INT Function Returns Incorrect Value on Power Macintosh
Last reviewed: September 12, 1996

Article ID: Q127745

The information in this article applies to:


 * Microsoft Excel for the Power Macintosh, versions 5.0, 5.0a

SYMPTOMS
In Microsoft Excel, when you use the INT function to truncate a very large number, the value returned by this function may not be an integer.

CAUSE
This problem occurs when you use the INT function in Microsoft Excel version 5.0 for the Power Macintosh, if the value that you are rounding is greater than 2^32, or 4294967296. For example, if you enter the following formula in cell A2

=INT(A1) where A1 contains the value 4294967297.55, the value returned by the INT function in cell A2 is 4294967297.55 instead of the expected value 4294967297.00.

Note that this is an isolated error in the function that performs the INT operation within Microsoft Excel for the Power Macintosh. This is not a problem with the way that Microsoft Excel calculates values with any other function.

This problem does not occur in the 68K version of Microsoft Excel for the Macintosh.

WORKAROUNDS
To work around this problem when you are working with numbers larger than 2^32, use any of the following methods.

Method 1: Use the following formula

=ROUND(x-0.5,0)

For example, instead of using the formula

=INT(A1)

use the formula

=ROUND(A1-0.5,0) Method 2: For positive values only, use the TRUNC function. The TRUNC

function truncates a number to an integer by removing the fractional part of the number. For negative values, this function rounds "up" instead of "down" the way the INT function does.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.