<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">&nbsp;&nbsp;&nbsp; Hi all,<br><br>&nbsp;&nbsp;&nbsp; I am trying to retrieve the decimal portion of a Double. My code is:<br><br>&nbsp;&nbsp;&nbsp; getDecimal x = x - floor(x)<br><br>&nbsp;&nbsp;&nbsp; I would expect the following:<br><br>&nbsp;&nbsp;&nbsp; Main&gt; getDecimal 1.23<br>&nbsp;&nbsp;&nbsp; 0.23 :: [Double]<br><br>&nbsp;&nbsp;&nbsp; but instead, I get:<br><br>&nbsp;&nbsp;&nbsp; Main&gt; getDecimal 1.23<br>&nbsp;&nbsp;&nbsp; ERROR - Unresolved overloading<br>&nbsp;&nbsp;&nbsp; *** Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : (RealFrac a, Integral a) =&gt; a<br>&nbsp;&nbsp;&nbsp; *** Expression : getDecimal 1.23<br><br>&nbsp;&nbsp;&nbsp; I have tried adding "getDecimal :: Double -&gt; Double" but it only causes the following message to appear:<br><br>&nbsp;&nbsp;&nbsp; ERROR file:C:\Documents and Settings\User\file.hs:60 - Instance of Integral Double
 required for definition of getDecimal<br><br>&nbsp;&nbsp;&nbsp; How should I define my function so that it'll work? Thanks!<br><br>&nbsp;&nbsp;&nbsp; Regards,<br>&nbsp;&nbsp;&nbsp; Dom<br></td></tr></table><br>