Here is a snippet for fast square root but it c++ code and it uses a union.

Is this possible with java/processing?

Is this possible with java/processing?

inline float fastSqrt_2(const float x) { union { int i; float x; } u; u.x = x; u.i = (1<<29) + (u.i >> 1) - (1<<22); return u.x; }

1