How to approximate double ?
        Posted  
        
            by Andrei Ciobanu
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Andrei Ciobanu
        
        
        
        Published on 2010-06-10T13:30:01Z
        Indexed on 
            2010/06/10
            18:13 UTC
        
        
        Read the original article
        Hit count: 292
        
How to I write a function that approximates a double in the following manner, returning an int:
function (2.3) -> 2
function (2.7) -> 3
function (-1.2) -> -1
function (-1.7) -> -2
© Stack Overflow or respective owner