Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple INT error?

In the debug window in Excel 2000, why does ? int( 0.6 * 100) give an answer of 59?

I know it's due to binary storage or something - but how do I correct it?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Simple INT error?

try:

? cint( 0.6 * 100) = 60
? .6*100 \1 = 60



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(Roger) wrote:

? int( 0.6 * 100)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Simple INT error?

I've never encountered that before. In XLv.X:

? int( 0.6 * 100)
60


In article ,
(Roger) wrote:

In the debug window in Excel 2000, why does ? int( 0.6 * 100) give an answer
of 59?

I know it's due to binary storage or something - but how do I correct it?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple INT error?

It appears to be caused by come conversion that is being performed:

? int( 0.6 * 100)
59

? int( 0.6! * 100)
60
? int( 0.6# * 100)
59


0.6 is double
0.6# is double
0.6! is single.
--
Regards,
Tom Ogilvy

"keepitcool" wrote in message
...
try:

? cint( 0.6 * 100) = 60
? .6*100 \1 = 60



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(Roger) wrote:

? int( 0.6 * 100)




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Simple INT error?

Another Intel error then. I haven't encountered this one either. Could anyone running an
Athlon processor please test this ?

It's easy enough to fix that particular calculation, problem is that INT is used a lot to
remove decimals from calculated big numbers (bigger than integer limits) and it would be
impossible to know when this happens or not. Hmmm. I have to proofread tons of code
because of this, buying Macs to my 3000 collegues is unfortunately no option <g.

Best wishes Harald
Followup to newsgroup only please.

"J.E. McGimpsey" wrote in message
...
I've never encountered that before. In XLv.X:

? int( 0.6 * 100)
60






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Simple INT error?

In article ,
"Harald Staff" wrote:

buying Macs to my 3000 collegues is unfortunately no option <g.


but have you tried??? Bet you could get a substantial discount!<g
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple INT error?

? int( 0.6 * 100)
59

AuthenticAMD AMD Athlon(tm) XP 2200+
224MB RAM

Excel 97 SR2

--
Regards,

Tom Ogilvy

Harald Staff wrote in message
...
Another Intel error then. I haven't encountered this one either. Could

anyone running an
Athlon processor please test this ?

It's easy enough to fix that particular calculation, problem is that INT

is used a lot to
remove decimals from calculated big numbers (bigger than integer limits)

and it would be
impossible to know when this happens or not. Hmmm. I have to proofread

tons of code
because of this, buying Macs to my 3000 collegues is unfortunately no

option <g.

Best wishes Harald
Followup to newsgroup only please.

"J.E. McGimpsey" wrote in message
...
I've never encountered that before. In XLv.X:

? int( 0.6 * 100)
60






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Simple INT error?

On Fri, 03 Oct 2003 09:05:09 -0600, "J.E. McGimpsey"
wrote:

I've never encountered that before. In XLv.X:

? int( 0.6 * 100)
60


That's odd.

Excel 2002(10.4524.4219) SP-2
in a worksheet =INT(0.6*100) -- 60

But in the VB6.3 that comes with it, I get 59 in the Immediate window, too.
?int(0.6*100)
59

XP Pro
Processor x86 Family 15 Model 2 Stepping 4 GenuineIntel ~1993 Mhz





--ron
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Simple INT error?

Thanks Tom. Interesting.

Best wishes Harald
Followup to newsgroup only please

"Tom Ogilvy" skrev i melding
...
? int( 0.6 * 100)
59

AuthenticAMD AMD Athlon(tm) XP 2200+
224MB RAM



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
#VALUE Error should be simple fix Mykull Excel Discussion (Misc queries) 4 May 5th 09 11:19 PM
My rounding error in a simple IF garron Excel Worksheet Functions 2 August 6th 08 04:11 AM
Fix Simple #Div/0! error taxmom Excel Worksheet Functions 4 April 18th 06 06:53 PM
Simple Error Dialogue box Rob Gould Excel Discussion (Misc queries) 2 March 17th 05 09:13 AM
Simple #DIV/0! error AMY Z. Excel Worksheet Functions 2 January 23rd 05 10:25 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"