Ranter
Join devRant
Do all the things like
				++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
				Sign Up
			Pipeless API
 
				From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
				Learn More
			Comments
		
- 
				
				@CoffeeSnake rand() can be any integer.
 % 100 does modulo division so that the result is in the range 0 to 99.
 Then, < 98 makes sure that the result is true for the most time, but sometimes false.
- 
				
				@Lensflare is there a limit for rand()? If not then I imagine it'd very rarely be true
- 
				
				@Lensflare I guess I was thinking of 0 to 100 % 100 < 98 would be kind of redundant. After thinking for a minute I see how this is basically a 100-sided dice roll.
Related Rants







 ⚫⚫⚫⚫🕯️🕯️🕯️🕯️
⚫⚫⚫⚫🕯️🕯️🕯️🕯️
 So true...
So true...
 Saw this a while back and decided to take a picture of it. Now I'm glad I did. XD
Saw this a while back and decided to take a picture of it. Now I'm glad I did. XD
Repost from r/programmerHumor
joke/meme
rand
false
true