rand() did not work on 2-byte machines
This commit is contained in:
		
							parent
							
								
									5512f14697
								
							
						
					
					
						commit
						c6a11d1f62
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -11,7 +11,7 @@ static unsigned long int next = 1; | |||
| int rand(void) | ||||
| { | ||||
| 	next = next * 1103515245 + 12345; | ||||
| 	return (unsigned int)(next/(2 * (RAND_MAX +1)) % (RAND_MAX+1)); | ||||
| 	return (unsigned int)(next/(2 * (RAND_MAX +1L)) % (RAND_MAX+1L)); | ||||
| } | ||||
| 
 | ||||
| void srand(unsigned int seed) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue