Cum transform un numar intreg intr-un numar real ?

From HaskellWiki
Revision as of 11:07, 25 October 2007 by Ha$kell (talk | contribs)
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


<= Inapoi la pagina principala Ro/Haskell