The cast on n = 10 is returning a weird float, not 10.0:
sqrt(cast[float](n))
How do I do /that/?cast is a bitwise cast; i.e. the bit pattern that represents the integer n is reinterpreted as a floating point representation. It's sort of what would happen in C++ if you did reinterpret_cast<double &>(n).
To convert an integer to a floating point value, simply use float(n) or n.float.