Closed GlitchlessCode closed 8 months ago
woah, impressive thanks! I gave up on trying to implement this
By the way, I ran some test data:
fail (Correct)
fail (Correct)
fail (Correct)
~0.0f (Correct) (This one was very slightly bigger than 0, but only after a lot zeros. It's effectively equivalent to 0)
~0.5f (Correct)
~1.0f (Correct)
~1.4142135f (Correct) aka ~√2 (Correct)
8.0f (Correct)
woah, impressive thanks! I gave up on trying to implement this
Ha, thanks. It's not my own algorithm, it's just one of the more common ones out there, but I just figured out how to implement it in MC, that's all
still more than I could figure out, I was mostly unmotivated because I only needed it to calculate distance and that has its own operation
still more than I could figure out, I was mostly unmotivated because I only needed it to calculate distance and that has its own operation
Fair. I'm personally planning to implement arcsin, arccos and arctan, which is why I wanted the sqrt, cause I couldn't find a simple solution for the inverse trigs that didn't use sqrt, or vice versa.
Which is why we have to settle for an approximation, but it's still very accurate at least.
I see, I think you have more ambitions for this repo than I do, I just did the operations I need accurate outputs for, I'll absolutely merge any ops you add though
The Suggestion
Add a square root function (√x) to the set of functions
Implementation description
gm:sqrt
to list of functions