I Guess:

Because when you use int(4.599) you get rid of what after the decimo point ,
The same logic apply to int(-4.599), So you get (-4.599-0.599)=-5.198 the
the final result is -5.

sima Lee

----- Original Message -----
From: Dick Applebaum <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 26, 2000 10:16 AM
Subject: RE: Surprising Results? [was] Re: Round down numbers


> Yeah, I guess the rounding is correct:
>
> I tried the tests in Excel & got the same Results:
>
>     =ROUND(4.599,2)+ROUND(-4.599,2)   gives   0
>
> But the int, I don't understand:
>
>     =INT(4.599)+INT(-4.599)   gives   -1
>
>
> Wonder why?
>
>
>
>
>
>
>
> At 3:43 PM +0100 7/26/00, Stephen Moretti wrote:
> >Dick,
> >
> >
> >[snip]
> >> <BR>.*.Round(-4.5).....Gives -5....Expect -4.....|#Round(-4.5)#|
> >> <BR>.*.Round(-4.4).....Gives -4....Expect -5.....|#Round(-4.4)#|
> >[snip]
> >> <BR>.*.Int(-4.5).......Gives -5....Expect -4.....|#int(-4.5)#|
> >> <BR>.*.Int(-4.4).......Gives -5....Expect -4.....|#int(-4.4)#|
> >[snip]
> >> .*.Round(-4.5).....Gives -5....Expect -4.....|-5|
> >> .*.Round(-4.4).....Gives -4....Expect -5.....|-4|
> >[snip]
> >> .*.Int(-4.5).......Gives -5....Expect -4.....|-5|
> >> .*.Int(-4.4).......Gives -5....Expect -4.....|-5|
> >
> >The rounding one is actually correct,  -4.5 should round to -5.
> >However the int on -4.4 and -4.5 are a bit strange.  I can't think why
this
> >would be, but I feel like there should be a reason.
> >
> >regards
> >
> >Stephen
> >
>
>---------------------------------------------------------------------------
---
> >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> >To Unsubscribe visit
> >http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_tal
> >k or send a message to [EMAIL PROTECTED] with
> >'unsubscribe' in the body.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to