The unified diff between revisions [4f22e7ef..] and [dc88787e..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'fisqrt.c'
# # old_revision [4f22e7ef7d3064e3b51a5b868a4722f3f13c747b] # new_revision [dc88787ecd1d574feba045763baed2a7651ff33d] # # patch "fisqrt.c" # from [65553ed1491b6b3d4a266cc821c3f117c623a203] # to [4fb1fdd34c6fc3f9e172991f3149c9c4057eb68e] # ============================================================ --- fisqrt.c 65553ed1491b6b3d4a266cc821c3f117c623a203 +++ fisqrt.c 4fb1fdd34c6fc3f9e172991f3149c9c4057eb68e @@ -6,12 +6,20 @@ float fisqrt(float n) { long i; float x2, y; + union { + float f; + long l; + } u; x2 = n * 0.5f; y = n; - i = *(long *)&y; +/* i = *(long *)&y; */ + u.f = y; + i = u.l; i = 0x5f3759df - (i>>1); - y = *(float *)&i; +/* y = *(float *)&i; */ + u.l = i; + y = u.f; y = y * (1.5f - (x2*y*y)); return y;