Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug in chsmpfr.c
Ignore-this: 73f70407828fb6467ab06cfe252c5539

darcs-hash:20090827210008-5fe1c-8e3dd9745b9e5dcaa644e9a1b5f23dd5b678e991.gz
  • Loading branch information
ab-concordium committed Aug 27, 2009
1 parent 40ab270 commit 7ac9a43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Data/Number/MPFR/Conversion.hs
Expand Up @@ -18,6 +18,7 @@
module Data.Number.MPFR.Conversion where

import Data.Number.MPFR.Internal
import Data.Number.MPFR.Comparison(isZero)
import Data.Number.MPFR.Misc

import Data.List (isInfixOf)
Expand Down Expand Up @@ -88,6 +89,7 @@ toStringExp :: Word -- ^ number of digits
-> MPFR -> String
toStringExp dec d | isInfixOf "NaN" ss = "NaN"
| isInfixOf "Inf" ss = s ++ "Infinity"
| isZero d = "0"
| e > 0 =
s ++ if Prelude.floor prec <= dec
then
Expand Down
2 changes: 1 addition & 1 deletion cbits/chsmpfr.c
Expand Up @@ -22,7 +22,7 @@ int mpfr_inf_p_wrap(const mpfr_ptr p) {
return mpfr_inf_p(p);
}
int mpfr_zero_p_wrap(const mpfr_ptr p) {
return mpfr_inf_p(p);
return mpfr_zero_p(p);
}

int mpfr_set_wrap(const mpfr_ptr p1, const mpfr_ptr p2, mp_rnd_t r) {
Expand Down

0 comments on commit 7ac9a43

Please sign in to comment.