Skip to main content
Senior
February 4, 2024
Question

Generated random number is negative, but I expect it to be positive

  • February 4, 2024
  • 1 reply
  • 1466 views

Hi, 

I am using HAL_RNG_GenerateRandomNumber API to generate random number between 0 to  4294967295, but when I debug the code, I see that the random number takes negative number.

Could anyone please help me with this?

Thanks.

 

 

demir_0-1707056133754.png

 

This topic has been closed for replies.

1 reply

TDK
Super User
February 4, 2024

Just an IDE bug. You can ignore it, or right click and view it as hex or something else.

"If you feel a post has answered your question, please click ""Accept as Solution""."