Commit 95e357e7 authored by rrt's avatar rrt
Browse files

[project @ 2001-09-03 09:27:18 by rrt]

Julian pointed out that as 0.0 is a bit string of 0s (at least for IEEE),
it's an easy result to get bogusly. So use cos instead of sin, expecting 1.0
back. Has all the other nice properties, plus better error detection.
parent c89ac427
......@@ -3,9 +3,9 @@ module Main (main) where
import IOExts ( unsafePerformIO )
c :: Double -> Double
c x = sin x
c x = cos x
where
sin :: Double -> Double
sin x = unsafePerformIO (_ccall_ sin x)
cos :: Double -> Double
cos x = unsafePerformIO (_ccall_ cos x)
main = putStr (shows (c 0.0) "\n")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment