Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
82b886b9
Commit
82b886b9
authored
May 27, 2008
by
Ian Lynagh
Browse files
Wibble the num009 test
parent
55a206a7
Changes
1
Show whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/lib/Numeric/num009.hs
View file @
82b886b9
...
...
@@ -5,31 +5,35 @@
module
Main
(
main
)
where
import
Control.Monad
import
Foreign.C
main
=
do
let
d
=
1e20
::
Double
f
=
1e20
::
Float
test
"sind"
sind
sin
1e20
test
"sinf"
sinf
sin
1e20
test
"cosd"
cosd
cos
1e20
test
"cosf"
cosf
cos
1e20
test
"tand"
tand
tan
1e20
test
"tanf"
tanf
tan
1e20
test
"sind"
sind
sin
d
test
"sinf"
sinf
sin
f
test
"cosd"
cosd
cos
d
test
"cosf"
cosf
cos
f
test
"tand"
tand
tan
d
test
"tanf"
tanf
tan
f
putStrLn
"Done"
test
::
Floating
a
=>
String
->
(
a
->
a
)
->
(
a
->
a
)
->
a
->
IO
()
test
s
f
g
x
=
do
let
y
=
f
x
test
::
(
RealFloat
a
,
Floating
a
,
RealFloat
b
,
Floating
b
)
=>
String
->
(
a
->
a
)
->
(
b
->
b
)
->
b
->
IO
()
test
s
f
g
x
=
do
let
y
=
realToFrac
(
f
(
realToFrac
x
))
z
=
g
x
unless
(
y
==
z
)
$
do
putStrLn
s
print
y
print
z
print
$
decodeFloat
y
print
$
decodeFloat
z
foreign
import
ccall
"math.h sin"
sind
::
Double
->
Double
foreign
import
ccall
"math.h sinf"
sinf
::
Float
->
Float
foreign
import
ccall
"math.h sin"
sind
::
C
Double
->
C
Double
foreign
import
ccall
"math.h sinf"
sinf
::
C
Float
->
C
Float
foreign
import
ccall
"math.h cos"
cosd
::
Double
->
Double
foreign
import
ccall
"math.h cosf"
cosf
::
Float
->
Float
foreign
import
ccall
"math.h cos"
cosd
::
C
Double
->
C
Double
foreign
import
ccall
"math.h cosf"
cosf
::
C
Float
->
C
Float
foreign
import
ccall
"math.h tan"
tand
::
Double
->
Double
foreign
import
ccall
"math.h tanf"
tanf
::
Float
->
Float
foreign
import
ccall
"math.h tan"
tand
::
C
Double
->
C
Double
foreign
import
ccall
"math.h tanf"
tanf
::
C
Float
->
C
Float
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment