ALS-Refactored icon indicating copy to clipboard operation
ALS-Refactored copied to clipboard

Check GroundedAmount with UE_SMALL_NUMBER make it safe not divided by zero

Open watsonsong opened this issue 9 months ago • 3 comments

The PoseState.GroundedAmount will used as a denominator. Check with UE_SMALL_NUMBER is better than 0 directly.

watsonsong avatar Apr 30 '24 10:04 watsonsong

Check with UE_SMALL_NUMBER is better than 0 directly.

I'm curious about the reason.

Isn't "Number > 0.0f" sufficient enough to avoid "divided by zero" error?

ameaninglessname avatar Apr 30 '24 10:04 ameaninglessname

Check with UE_SMALL_NUMBER is better than 0 directly.

I'm curious about the reason.

Isn't "Number > 0.0f" sufficient enough to avoid "divided by zero" error?

It just keep the same check in other code. For example Here check DeltaTime.

watsonsong avatar May 01 '24 01:05 watsonsong

Check with UE_SMALL_NUMBER is better than 0 directly.

I'm curious about the reason. Isn't "Number > 0.0f" sufficient enough to avoid "divided by zero" error?

It just keep the same check in other code. For example Here check DeltaTime.

Got it, if so, should we do that in all similar places?

ameaninglessname avatar May 01 '24 03:05 ameaninglessname