Skip to content

Conversation

@turborium
Copy link

Fixing UB in fastpow

Fixing UB in fastpow
@NoelJB
Copy link

NoelJB commented Jan 12, 2026

I perceive that your intent is to ensure that the memory moves are correctly sized, but why not make the simpler fix of including stdint.h and changing the integer to int32_t? The float type is already standardized as 32-bit by IEEE.

Thoughts?

@qasim78678
Copy link

Good point, that would definitely be a cleaner and more readable fix.
Using int32_t makes the intent explicit and avoids relying on assumptions about int size. I can update the patch to include <stdint.h> and switch to int32_t instead. Thanks for pointing that out.

@dannythehumbleguy
Copy link

Top notch fix, It must be approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants