signbit returns bool, not int
Avoid more cases where signbit is treated as int

Backport of b32a48f5c4e09245f5985034c28908ac152c8da1
Backport of 8806a2d5548442c959528a62e6fe2910ed1b507e

for #8414