Skip to content

Fix NaN in sqrt formula#12

Open
sjonkeesse wants to merge 1 commit intoleech001:masterfrom
sjonkeesse:patch-1
Open

Fix NaN in sqrt formula#12
sjonkeesse wants to merge 1 commit intoleech001:masterfrom
sjonkeesse:patch-1

Conversation

@sjonkeesse
Copy link

When Gyro_X_Raw and Gyro_Z_Raw are both -32768, this results in NaN in the square root calculation when the calculation to the power of two is done with var x var. Using the math method pow() solves the problem.

image

When Gyro_X_Raw and Gyro_Z_Raw are both -32768, this results in NaN in the square root calculation when the calculation to the power of two is done with var x var. Using the math method pow() solves the problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant