mirror of
				https://github.com/eledio-devices/thirdparty-tinyexpr.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	fix overflow check bug
This commit is contained in:
		| @@ -127,7 +127,7 @@ static double fac(double a) {/* simplest version of fac */ | ||||
|     unsigned int ua = (unsigned int)(a); | ||||
|     unsigned long int result = 1, i = 1; | ||||
|     for (i = 1; i <= ua; i++) { | ||||
|         if (ua > ULONG_MAX / result) | ||||
|         if (i > ULONG_MAX / result) | ||||
|             return INFINITY; | ||||
|         result *= i; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user