Why does 24*60*60 = overflow ? 
Author Message
 Why does 24*60*60 = overflow ?

I've found that attempting to set a variable (single) to the result of
24*60*60 gives an Overflow error. This also happens in the Debug window if
?24*60*60 is entered.

The answer ( 86400 ) is well within the bounds of a single so shouldn't give
an error.

Entering ?CSng(24) *CSng(60)*CSng(60) gives the correct result and no
error - what's the problem ?

TIA
Nigel



Tue, 16 Oct 2001 03:00:00 GMT  
 Why does 24*60*60 = overflow ?
Hi,

You got, by default, a short integer, not a single precision floating point
number. Clearly, 86400 exceed 32000 + something. Using 24*60*60&  is also a
solution.

Hope it may help,
Vanderghast, Access MVP.


Quote:
> I've found that attempting to set a variable (single) to the result of
> 24*60*60 gives an Overflow error. This also happens in the Debug window if
> ?24*60*60 is entered.

> The answer ( 86400 ) is well within the bounds of a single so shouldn't
give
> an error.

> Entering ?CSng(24) *CSng(60)*CSng(60) gives the correct result and no
> error - what's the problem ?

> TIA
> Nigel



Tue, 16 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 7 * 24 * 60 * 60 = OverFlow !?

2. CInt(60) * 1000 produces overflow?

3. Filesize to 60% by /decompile

4. LOOKUP BOX > 60 OBJECTS-NO SCROLL

5. Error 800a0011 - CommonDialog 60 on Excel user form

6. Visual Studio Net 60 Day Trial DVD

7. Ann: Zeus Programmers Editor V3.60

8. Ann: Zeus Programmers Editor V3.60

9. Re - Crystal reports(V4.60) problem in Client/server App

10. Sleep API is using up 60% CPU time in the DLL

11. Adding the numbers 1 - 60 to a combobox.....

12. Visual basic 60 service pack 4

 

 
Powered by phpBB® Forum Software