mirror of
				https://github.com/VCMP-SqMod/SqMod.git
				synced 2025-10-30 13:57:20 +01:00 
			
		
		
		
	Fix the digit counting helpers to take into account negative values.
This commit is contained in:
		| @@ -1075,7 +1075,7 @@ static SQInteger SqDigits1(HSQUIRRELVM vm) | ||||
|         return sq_throwerror(vm, "Wrong number of arguments"); | ||||
|     } | ||||
|     // Fetch the integer value from the stack | ||||
|     Int64 n = PopStackLong(vm, 2); | ||||
|     Int64 n = std::llabs(PopStackLong(vm, 2)); | ||||
|     // Start with 0 digits | ||||
|     Uint8 d = 0; | ||||
|     // Identify the number of digits | ||||
| @@ -1099,7 +1099,7 @@ static SQInteger SqDigits0(HSQUIRRELVM vm) | ||||
|         return sq_throwerror(vm, "Wrong number of arguments"); | ||||
|     } | ||||
|     // Fetch the integer value from the stack | ||||
|     Int64 n = PopStackLong(vm, 2); | ||||
|     Int64 n = std::llabs(PopStackLong(vm, 2)); | ||||
|     // Start with 0 digits | ||||
|     Uint8 d = 0; | ||||
|     // Identify the number of digits | ||||
|   | ||||
		Reference in New Issue
	
	Block a user