Skip to content

Commit

Permalink
Fix function documentation grammar
Browse files Browse the repository at this point in the history
Co-authored-by: Taj <[email protected]>
  • Loading branch information
yan-aint-nickname and tjgurwara99 authored Aug 30, 2023
1 parent 72b4863 commit 5d2d69e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions math/binary/fast_inverse_sqrt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"math"
)

// FastInverseSqrt assumes that number always positive
// You don't want to deal with complex numbers
// "magic" number 0x5f3759df from base 16 to base 10 is equal to 1597463007
// math.Float32bits is alias to *(*uint32)(unsafe.Pointer(&f))
// and math.Float32frombits to *(*float32)(unsafe.Pointer(&b))
// 4 >> 1 = 2 bitwise shift to the right by one divides the number by 2
// FastInverseSqrt assumes that argument is always positive,
// and it does not deal with negative numbers.
// The "magic" number 0x5f3759df is hex for 1597463007 in decimals.
// The math.Float32bits is alias to *(*uint32)(unsafe.Pointer(&f))
// and math.Float32frombits is to *(*float32)(unsafe.Pointer(&b)).
func FastInverseSqrt(number float32) float32 {
var i uint32
var y, x2 float32
Expand Down

0 comments on commit 5d2d69e

Please sign in to comment.