Cum transform un numar intreg intr-un numar real ?
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Ca un exercitiu, puteti scrie si dumneavoastra o functie care sa transforme un intreg intr-un real sau invers dar aceste functii sunt deja definite:
Incercati sa folositi:
fromInt :: Int -> Float -- transforma un Int intr-un Float .
ceiling :: Float -> Int -- rotunjeste la intregul imediat superior
floor :: Float -> Int -- rotunjeste la intregul imediat inferior
round :: Float -> Int -- rotunjeste la intregul cel mai apropiat