Bug when ising INT function
Author Message
Bug when ising INT function

In the Access 97 debug window ?Int(-16.1) returns 17? I would have expected
this to return 16. The same is true for any negative value.

Is this a bug or a feature?

Thanks

Roy Bland
Sheffield Hallam University

Mon, 27 Mar 2000 03:00:00 GMT
Bug when ising INT function

Hi,

can also consider that Int( x ) returns the biggest integer smaller or equal
to x.

-17 is the biggest integer smaller than -16.1; also note that -16 is bigger
that -16.1, while 16 is smaller than 16.1

Hope it may help,
Vanderghast, Access MVP

Quote:

>If you look in the help file under Int you'll find the following

>Quote starts ------
>The difference between Int and Fix is that if number is negative, Int
>returns the first negative integer less than or equal to number, whereas
Fix
>returns the first negative integer greater than or equal to number. For
>example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
>----- Quote ends

>So as you can see it is neither a bug nor a feature but is working as
>designed.

>>In the Access 97 debug window ?Int(-16.1) returns 17? I would have
expected
>>this to return 16. The same is true for any negative value.

>>Is this a bug or a feature?

>>Thanks

>>Roy Bland
>>Sheffield Hallam University

Mon, 27 Mar 2000 03:00:00 GMT
Bug when ising INT function

If you look in the help file under Int you'll find the following

Quote starts ------
The difference between Int and Fix is that if number is negative, Int
returns the first negative integer less than or equal to number, whereas Fix
returns the first negative integer greater than or equal to number. For
example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
----- Quote ends

So as you can see it is neither a bug nor a feature but is working as
designed.

Quote:

>In the Access 97 debug window ?Int(-16.1) returns 17? I would have expected
>this to return 16. The same is true for any negative value.

>Is this a bug or a feature?

>Thanks

>Roy Bland
>Sheffield Hallam University

Mon, 27 Mar 2000 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages