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  
 
 [ 3 post ] 

 Relevant Pages 

1. ???Bug in Int()-function of ACC95 and ACC97 ???

2. BUG: VB4(16 bit) - Int and Fix functions don't work correctly

3. TERRIBLE BUG IN INT FUNCION???????????????????

4. Bug in Int() and Numbers

5. BUG?? Weird Int rounding

6. Converting BitArray to Int and Int to BitArray

7. How to display int, short int range values

8. Int to Str or Str to Int ??

9. Converting ULONG (4 byte binary) int VB Long / SQL INT for DTS Import

10. Convert Int to Str & Str to Int

11. int main( int argc, char *argv[]) in VB??

12. Strange behavior with INT function

 

 
Powered by phpBB® Forum Software