Fix "Unit overflow in pow()" error
During tests on Debian/Ubuntu : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836983 a problem was found when raising a unit to a negative power on some architectures. By default some architectures have "char" being unsigned such as the ones listed here and others ( https://wiki.debian.org/ArchitectureSpecificsMemo ). I just forced the sign-ness of pow()'s argument which fixes the issue.
This commit is contained in:
@@ -127,7 +127,7 @@ Unit::Unit(const QString& expr)
|
||||
}
|
||||
}
|
||||
|
||||
Unit Unit::pow(char exp) const
|
||||
Unit Unit::pow(signed char exp) const
|
||||
{
|
||||
checkRange("pow()",
|
||||
(int32_t)Sig.Length * (int32_t)exp,
|
||||
|
||||
Reference in New Issue
Block a user