Hello Dick,

As a mathemetics student all of these answers seem correct to me ...
Round(-4.5) indeed is -5
Int(-4.5) indeed is -5

Johan Coens

-----Original Message-----
From: Dick Applebaum [mailto:[EMAIL PROTECTED]]
Sent: woensdag 26 juli 2000 15:55
To: [EMAIL PROTECTED]
Subject: Surprising Results? [was] Re: Round down numbers


Hmmm.....

All this talk about rounding up/down... thought I'd experiment:

        <CFOUTPUT>
        <CODE>
        <BR>...Ceiling(4.5)....Gives 5.....Expect 5......|#Ceiling(4.5)#|
        <BR>...Ceiling(4.4)....Gives 5.....Expect 5......|#Ceiling(4.4)#|
        <BR>...Ceiling(-4.5)...Gives -4....Expect -4.....|#Ceiling(-4.5)#|
        <BR>...Ceiling(-4.4)...Gives -4....Expect -4.....|#Ceiling(-4.4)#|
        <BR>...Round(4.5)......Gives 5.....Expect 5......|#Round(4.5)#|
        <BR>...Round(4.4)......Gives 4.....Expect 4......|#Round(4.4)#|
        <BR>.*.Round(-4.5).....Gives -5....Expect -4.....|#Round(-4.5)#|
        <BR>.*.Round(-4.4).....Gives -4....Expect -5.....|#Round(-4.4)#|
        <BR>...Int(4.5)........Gives 4.....Expect 4......|#int(4.5)#|
        <BR>...Int(4.4)........Gives 4.....Expect 4......|#int(4.4)#|
        <BR>.*.Int(-4.5).......Gives -5....Expect -4.....|#int(-4.5)#|
        <BR>.*.Int(-4.4).......Gives -5....Expect -4.....|#int(-4.4)#|
        <BR>...Fix(4.5)........Gives 4.....Expect 4......|#Fix(4.5)#|
        <BR>...Fix(4.4)........Gives 4.....Expect 4......|#Fix(4.4)#|
        <BR>...Fix(-4.5).......Gives -4....Expect -4.....|#Fix(-4.5)#|
        <BR>...Fix(-4.4).......Gives -4....Expect -4.....|#Fix(-4.4)#|
        </CODE>
        </CFOUTPUT>

Gives the somewhat unexpected:

        ...Ceiling(4.5)....Gives 5.....Expect 5......|5|
        ...Ceiling(4.4)....Gives 5.....Expect 5......|5|
        ...Ceiling(-4.5)...Gives -4....Expect -4.....|-4|
        ...Ceiling(-4.4)...Gives -4....Expect -4.....|-4|
        ...Round(4.5)......Gives 5.....Expect 5......|5|
        ...Round(4.4)......Gives 4.....Expect 4......|4|
        .*.Round(-4.5).....Gives -5....Expect -4.....|-5|
        .*.Round(-4.4).....Gives -4....Expect -5.....|-4|
        ...Int(4.5)........Gives 4.....Expect 4......|4|
        ...Int(4.4)........Gives 4.....Expect 4......|4|
        .*.Int(-4.5).......Gives -5....Expect -4.....|-5|
        .*.Int(-4.4).......Gives -5....Expect -4.....|-5|
        ...Fix(4.5)........Gives 4.....Expect 4......|4|
        ...Fix(4.4)........Gives 4.....Expect 4......|4|
        ...Fix(-4.5).......Gives -4....Expect -4.....|-4|
        ...Fix(-4.4).......Gives -4....Expect -4.....|-4|



At 8:30 AM -0400 7/26/00, Bud wrote:
>On 7/26/00, wai-leng penned:
>>Hi all,
>>
>>I am using Round () to round numbers but I would like it to round down
>>ie 469.50 should be evaluated as 469 instead of 470.
>>
>>Any suggestions please
>
>Well, since round always rounds up or down accordingly, except .5
>which always rounds up, I presume you always want to round down, in
>which case int(number) will do it.
>--
>
>Bud Schneehagen - Tropical Web Creations
>
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>ColdFusion Solutions / eCommerce Development
>[EMAIL PROTECTED]
>http://www.twcreations.com/
>954.721.3452
>---------------------------------------------------------------------------
---
>Archives: http://www.mail-archive.com/[email protected]/
>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/[email protected]/
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/[email protected]/
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