https://bugs.llvm.org/show_bug.cgi?id=34100

            Bug ID: 34100
           Summary: [APFloat] DoubleAPFloat::changeSign results in unusual
                    values.
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
          Assignee: unassignedb...@nondot.org
          Reporter: edy.b...@gmail.com
                CC: llvm-bugs@lists.llvm.org

`DoubleAPFloat::make*` always uses positive zero `Floats[1]`, even if
`Floats[0]` becomes negative (for a `Neg=true` argument).
But `DoubleAPFloat::changeSign` changes *both* `Floats[0]` and `Floats[1]`,
even when the latter is zero.
That makes negating a positive zero or infinity that is *different* than the
ones created by `makeZero(true)` and `makeInf(true)`, respectively.

My fix would be to guard the `Floats[1].changeSign();` call by
`if(Floats[1].isFiniteNonZero())`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to