
othermath
406
1
1

This example shows how these equations are treated. If the first sign of the radical expression is positive then the function sin() is replaced by the function cos(). Here the conversion of an integer to Gray code differs from the standard method, as you do not need to convert the number to binary first (both methods are equivalent).
To make it clearer, my method for converting an integer to Gray code (binary) uses successive divisions by powers of 2 and looks at the parity of the rounded quotient.
Example
29/2 = 14.5 ≈ 15 ⇒ 1
29/4 = 7.25 ≈ 7 ⇒ 1
29/8 = 3.625 ≈ 4 ⇒ 0
29/16 = 1.8125 ≈ 2 ⇒ 0
29/32 = 0.90625 ≈ 1 ⇒ 1
The decimal value 29 has the binary value 10011 in Gray code.
TyrTheTired
This seems like the most-complicated version of Halves and Doubles I've ever seen. Also, it's wrong. https://www.convertbinary.com/numbers/
TyrTheTired
Unless "Gray Code" somehow has a different counting system for binary.
FINNSTAR7
It's not converting 57 into binary, it converting 57 into Gray Code, it's its own system.
FINNSTAR7
Binary converts a number into a base 2 representation. Gray Code converts a number into a boolean string of odds and evens.
TyrTheTired
Interesting. I learned something new today. Thank you.