blob: ee96170af8ef1f1fdb6d0182969f1474599b1898 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
module Main where
import Numeric
import System.IO
main = do
let d = read "2.0e-2" :: Double
print $ "Float Version : " ++ (fToStr $ realToFrac d)
print $ "Double Version: " ++ (dToStr d)
double :: IO Double
double = do
x <- getLine
return $ read x
dToStr :: Double -> String
dToStr d = show d
fToStr :: Float -> String
fToStr = (dToStr . realToFrac)
|