some rng fixes
							parent
							
								
									d1983bf168
								
							
						
					
					
						commit
						231575757e
					
				|  | @ -117,8 +117,7 @@ namespace MoonTools.ECS | ||||||
| 
 | 
 | ||||||
| 		public int Next(int n) | 		public int Next(int n) | ||||||
| 		{ | 		{ | ||||||
| 			var next = NextInternal(); | 			return (int) (((double) Next()) * n / int.MaxValue); | ||||||
| 			return (int) (((double) next) * n / uint.MaxValue); |  | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		public int Next(int min, int max) | 		public int Next(int min, int max) | ||||||
|  | @ -131,7 +130,7 @@ namespace MoonTools.ECS | ||||||
| 		public long NextInt64() | 		public long NextInt64() | ||||||
| 		{ | 		{ | ||||||
| 			long next = NextInternal(); | 			long next = NextInternal(); | ||||||
| 			next <<= 32; | 			next <<= 31; | ||||||
| 			next |= NextInternal(); | 			next |= NextInternal(); | ||||||
| 			return next; | 			return next; | ||||||
| 		} | 		} | ||||||
|  | @ -139,7 +138,7 @@ namespace MoonTools.ECS | ||||||
| 		public long NextInt64(long n) | 		public long NextInt64(long n) | ||||||
| 		{ | 		{ | ||||||
| 			var next = NextInt64(); | 			var next = NextInt64(); | ||||||
| 			return (long) (((double) next) * n / ulong.MaxValue); | 			return (long) (((double) next) * n / long.MaxValue); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		public long NextInt64(long min, long max) | 		public long NextInt64(long min, long max) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue