I would like to do smth like:
x `mod` 1.0 == 0 // => int
but it seems mod works only for int… help!
EDIT:
I am trying to check if given number is triangle, http://en.wikipedia.org/wiki/Triangle_number so my idea was to check if n1 is Int…
(n*(n+1))/2 = s => n1 = (-1 +sqrt(1 +
8s))/2
Total edit:
Okay, I’m still not sure what you’re trying to accomplish here.
Data.Fixeddoes have amod'function for non-integral values.modandsqrtoperations in the same calculation, you’ll have to manually convert between appropriate types.fromIntegralwill convert any integer type into any number type,floor,ceiling, androundwill convert fractional types to integral types.