Fixes incorrect logic that went unnoticed until the function was tested with output and input types that have the same underlying floating-point format.
Fixes incorrect logic that went unnoticed until the function was tested with output and input types that have the same underlying floating-point format.