mirror of
				https://strlcat.eu/rys/tfnoisegen.git
				synced 2025-10-31 16:10:38 +01:00 
			
		
		
		
	tfprng: expose range formula in form of macros to build custom range generators.
This commit is contained in:
		
							
								
								
									
										2
									
								
								tfprng.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tfprng.c
									
									
									
									
									
								
							| @ -85,7 +85,7 @@ TFNG_UNIT_TYPE tfng_prng_range_r(void *sdata, TFNG_UNIT_TYPE s, TFNG_UNIT_TYPE d | ||||
| { | ||||
| 	TFNG_UNIT_TYPE c = tfng_prng_random_r(sdata); | ||||
| 	if (d <= s) return s; | ||||
| 	return s + c / ((TFNG_UNIT_TYPE)~0 / (d - s + 1) + 1); | ||||
| 	return TFNG_PRNG_RANGE(c, TFNG_UNIT_TYPE, s, d); | ||||
| } | ||||
|  | ||||
| TFNG_UNIT_TYPE tfng_prng_range(TFNG_UNIT_TYPE s, TFNG_UNIT_TYPE d) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user