It appears as though your code is working and you need help refactoring it. StackOverflow is for asking questions about non-working code. I would suggest you post this question on either Software Engineering or Code Review. — Abion4732 secs ago
@Kittoes0124 Sorry you had a bad experience. Since your question is about an algorithm (without showing any code to debug), you would be welcomed on other SE sites: math.stackexchange.commathoverflow.netsoftwareengineering.stackexchange.comcs.stackexchange.com It wasn't clear if 1 - SQRT(0.5) was the only number you needed or a general non-float function. If one, you can use a program to create a .h with predefined constants. Otherwise, there are other algs that may be better with fixed-point formats (e.g. binary search). — Craig Estey50 secs ago