31 May
2001
31 May
'01
4:25 p.m.
Can anyone please help me.
How can you divide two floats? (and return a float, even if they divide equally)
Ie (something like...) div 2.4 1.2 ---> 2.0
The above doesn't work since div can only be applied to integral numbers: div :: Integral a => a -> a -> a What you need is the operator (/) which can only be applied to fractional numbers: (/) :: Fractional a => a -> a -> a For example: 2.4 / 1.2 ---> 2.0 or (/) 2.4 1.2 ---> 2.0 Dan Russell Kingston University
9220
Age (days ago)
9220
Last active (days ago)
0 comments
1 participants
participants (1)
-
Daniel Russell