Scheme will give you an inexact number if either of the inputs to max
(or other operations for that matter) are inexact.
The standards document, R5RS, has this to say in section 6.2.5 Numerical operations
when discussing min
and max
:
Note: If any argument is inexact, then the result will also be inexact inexact (unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations).
Now there's possibly a case to be made that 144
is very much greater than 0.9954079577517649
but it would depend of the level of inaccuracy in that latter number. If the inaccuracy is on the order of a billion percent, it may well be much greater than 144
:-)
Section 6.2.2 Exactness
of that standard also has this:
Scheme numbers are either exact or inexact. A number is exact if it was written as an exact constant or was derived from exact numbers using only exact operations.
A number is inexact if it was written as an inexact constant, if it was derived using inexact ingredients, or if it was derived using inexact operations.
Thus inexactness is a contagious property of a number.
The 0.99
-ish number is inexact because sine and many other trigonometric functions are inherently inexact operations. The result of the max
is inexact because it has inexact inputs.