RotateVectorAroundAxis breaks when "Angle Deg" = -0.0f

When I pass in a value of -0.0f for the “Angle Deg” input into the RotateVectorAroundAxis blueprint function, the output vector is broken. Printing the vector to log reveals that it’s value is “X=-1.#IO Y=-1.#IO Z=-1.#IO”.

Hi janimationd,

Unfortunately I haven’t been able to reproduce this on my end. Do you have any other steps that may be causing this to occur? What outcome are you looking for?

I just tried recreating it and I also could not reproduce it outside of the situation where I see it happening. Here is what I’m observing. My blueprints are set up like this (ignore extraneous connections):

The Print String prints the following string:
“In Vec = X=-0.004 Y=0.000 Z=1.000, Axis = X=-1.000 Y=0.000 Z=-0.004, In Deg = 0.0, output = X=-1.#IO Y=-1.#IO Z=-1.#IO

Some information is being hidden by the conversions to string somewhere, because when I plug these exact numbers into a different RotateVectorAroundAxis function, it works fine. The input to the multiplication I have here is also reported as “0.0” when I print it out.

I did some digging into what the “-1.#IO” form means and it appears to occur when you try to format an infinite or indeterminate float value with a set amount of decimal points for printing

I still have no idea what is going on.

Conceptually, -1/0 is a negative infinite value, so it could simply be registering that -0.0f is the representative of negative infinity. Additionally, the engine converts rotation data to quarternions to compute rotation values. What are you attempting to do with the rotation value?

I’m using the output from the RotateVectorAroundAxis function to display some debug lines, and I first noticed that something was up because my debug lines had no endpoints. Regardless of what I’m using it for, there is still something fishy going on in one of these functions somewhere.

What number are you plugging into the x -1 that is in your angle deg? The reason I am asking is because it is reporting the -1#IO error, which as stated indicates a negative infinite value which cannot be printed because it is, as it says, infinite. Depending upon the circumstance, it may be as simple as the computation that is being utilized produces an infinite number outcome, which would absolutely cause this to occur.

I managed to figure it out, hidden in some code I had, there was an edge case where the value I was passing into that multiplication could be equivalent to NAN from math.h, which is “(float)((float)((double)(1e+300) * (double)(1e+300)) * 0.0f)”. It looks like this causes a float overflow. I guess it might be nice to be able to see that this is an invalid value when it’s converted to an FString, rather than just have it printed as “0.0”.

See my answer below, I figured it out.