>Actually i need to know how to detect if a number is a perfect square.
>But i'v been thinking..
>if i sqrt(x) and check if this result has mantissa... so it is not a
>interger...and surely not a perfect square.
>
>Well my question is... how can i verify if a number has mantissa???
A floating point number *ALWAYS* has a mantissa, regardless of whether
it is an exact integer or not.
fmod(x, 1.0) should return an exact zero if x is an exact integer
(in a floatingpoint variable). Two problems: fmod() is not defined
to be exact, although in practice that should not be a problem.
Also x might not be an exact integer even if it mathematically
SHOULD be exact, and sqrt() is likely to have roundoff error.
Gordon L. Burditt
