
26 Feb
2008
26 Feb
'08
2:39 a.m.
On Tue, 26 Feb 2008, Daniel Fischer wrote:
Am Dienstag, 26. Februar 2008 01:32 schrieb Ben:
Ok, that makes sense. There's no num k that's both Fractional and Integral, where as in the case where I had the number literals, those were two different instances. What's the usual way of working around this? Something like
(\k -> (1/ fromInteger k) ^ k) 3
?
Or use another exponentiation operator, in this case (**),
If the exponent is integral it's best to tell the compiler about it, thus prefer (^)! x^3 never raises problems, whereas (-1)**3 may fail, say if the 3 is actually 3.000000001 due to rounding errors.