[llvm-commits] [llvm] r161929 - in /llvm/trunk: lib/Support/APFloat.cpp unittests/ADT/APFloatTest.cpp
Matt Beaumont-Gay
matthewbg at google.com
Tue Aug 14 23:42:22 PDT 2012
On Tue, Aug 14, 2012 at 10:39 PM, Owen Anderson <resistor at mac.com> wrote:
> Author: resistor
> Date: Wed Aug 15 00:39:46 2012
> New Revision: 161929
>
> URL: http://llvm.org/viewvc/llvm-project?rev=161929&view=rev
> Log:
> Fix a problem with APFloat::roundToIntegral where it would return incorrect results for negative inputs to trunc. Add unit tests to verify this behavior.
>
> Modified:
> llvm/trunk/lib/Support/APFloat.cpp
> llvm/trunk/unittests/ADT/APFloatTest.cpp
>
> Modified: llvm/trunk/lib/Support/APFloat.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=161929&r1=161928&r2=161929&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/APFloat.cpp (original)
> +++ llvm/trunk/lib/Support/APFloat.cpp Wed Aug 15 00:39:46 2012
> @@ -1774,19 +1774,31 @@
> // precision of our format, and then subtract it back off again. The choice
> // of rounding modes for the addition/subtraction determines the rounding mode
> // for our integral rounding as well.
> + // NOTE: When the input value is negative, we do subtractation followed by
Typo: "subtractation"
More information about the llvm-commits
mailing list