Skip to content

Commit

Permalink
Add fmma and fmms; update tests; minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
casevh committed Oct 21, 2018
1 parent 6aa78b2 commit d4f9a77
Show file tree
Hide file tree
Showing 11 changed files with 541 additions and 47 deletions.
4 changes: 4 additions & 0 deletions scripts/show-cov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
lcov --capture --directory build/temp.linux-x86_64-3.6/src/gmpy2.gcno --output-file build/coverage.info
genhtml build/coverage.info --output-directory build/out
firefox build/out/index.html &
4 changes: 4 additions & 0 deletions src/gmpy2.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ static PyMethodDef Pygmpy_methods [] =
{ "floor", GMPy_Context_Floor, METH_O, GMPy_doc_function_floor },
{ "fma", GMPy_Context_FMA, METH_VARARGS, GMPy_doc_function_fma },
{ "fms", GMPy_Context_FMS, METH_VARARGS, GMPy_doc_function_fms },
#if MPFR_VERSION_MAJOR > 3
{ "fmma", GMPy_Context_FMMA, METH_VARARGS, GMPy_doc_function_fmma },
{ "fmms", GMPy_Context_FMMS, METH_VARARGS, GMPy_doc_function_fmms },
#endif
{ "fmod", GMPy_Context_Fmod, METH_VARARGS, GMPy_doc_function_fmod },
{ "frac", GMPy_Context_Frac, METH_O, GMPy_doc_function_frac },
{ "free_cache", GMPy_MPFR_Free_Cache, METH_NOARGS, GMPy_doc_mpfr_free_cache },
Expand Down
1 change: 0 additions & 1 deletion src/gmpy2_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ GMPy_MPFR_New(mpfr_prec_t bits, CTXT_Object *context)
{
MPFR_Object *result;


if (bits < 2) {
CHECK_CONTEXT(context);
bits = GET_MPFR_PREC(context);
Expand Down
8 changes: 6 additions & 2 deletions src/gmpy2_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,16 @@ static PyMethodDef GMPyContext_methods[] =
{ "expm1", GMPy_Context_Expm1, METH_O, GMPy_doc_context_expm1 },
{ "exp10", GMPy_Context_Exp10, METH_O, GMPy_doc_context_exp10 },
{ "exp2", GMPy_Context_Exp2, METH_O, GMPy_doc_context_exp2 },
{ "factorial", GMPy_Context_Factorial, METH_O, GMPy_doc_context_factorial },
{ "floor", GMPy_Context_Floor, METH_O, GMPy_doc_context_floor },
{ "floor_div", GMPy_Context_FloorDiv, METH_VARARGS, GMPy_doc_context_floordiv },
{ "fma", GMPy_Context_FMA, METH_VARARGS, GMPy_doc_context_fma },
{ "fmod", GMPy_Context_Fmod, METH_VARARGS, GMPy_doc_context_fmod },
{ "fms", GMPy_Context_FMS, METH_VARARGS, GMPy_doc_context_fms },
{ "factorial", GMPy_Context_Factorial, METH_O, GMPy_doc_context_factorial },
#if MPFR_VERSION_MAJOR > 3
{ "fmma", GMPy_Context_FMMA, METH_VARARGS, GMPy_doc_context_fmma },
{ "fmms", GMPy_Context_FMMS, METH_VARARGS, GMPy_doc_context_fmms },
#endif
{ "fmod", GMPy_Context_Fmod, METH_VARARGS, GMPy_doc_context_fmod },
{ "frac", GMPy_Context_Frac, METH_O, GMPy_doc_context_frac },
{ "frexp", GMPy_Context_Frexp, METH_O, GMPy_doc_context_frexp },
{ "fsum", GMPy_Context_Fsum, METH_O, GMPy_doc_context_fsum },
Expand Down
Loading

0 comments on commit d4f9a77

Please sign in to comment.