{ "info": { "author": "Mark Dickinson", "author_email": "dickinsm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "The ``bigfloat`` package is a Python package providing arbitrary-precision\r\ncorrectly-rounded binary floating-point arithmetic. It is implemented as a\r\n`Cython `_ wrapper around the `GNU MPFR library\r\n`_. A couple of lines of Python code should give the\r\nidea::\r\n\r\n >>> from bigfloat import *\r\n >>> with precision(200) + RoundTowardZero:\r\n ... print(sqrt(2))\r\n ...\r\n 1.4142135623730950488016887242096980785696718753769480731766796\r\n >>> with quadruple_precision:\r\n ... const_pi()\r\n ...\r\n BigFloat.exact('3.14159265358979323846264338327950280', precision=113)\r\n\r\nFeatures\r\n--------\r\n\r\n- Supports Python 2 (version 2.6 or later) and Python 3 (version 3.2 or later).\r\n\r\n- Exactly reproducible correctly-rounded results across platforms;\r\n precisely-defined semantics compatible with the IEEE 754-2008 standard.\r\n\r\n- Support for mixed-type operations with Python integers and floats.\r\n\r\n- Support for emulating IEEE 754 arithmetic in any of the IEEE binary\r\n interchange formats described in IEEE 754-2008. Infinities, NaNs,\r\n signed zeros, and subnormals are all supported.\r\n\r\n- Easy control of rounding modes and precisions via ``Context`` objects\r\n and Python's ``with`` statement.\r\n\r\nDocumentation\r\n-------------\r\n\r\nFull `package documentation `_ is hosted at\r\nRead the Docs. Read on for a quick tour.\r\n\r\nA quick tour\r\n------------\r\n\r\nThe ``bigfloat`` package is small and simple to use. Here's a quick\r\ntour of some of its features.\r\n\r\nFor demonstration purposes, start with::\r\n\r\n >>> from bigfloat import *\r\n\r\nNote that this import shadows four builtin Python functions, namely\r\n``abs``, ``max``, ``min`` and ``pow``. In normal usage you'll\r\nprobably only want to import the classes and functions that you\r\nactually need.\r\n\r\nThe main class is the ``BigFloat`` class::\r\n\r\n >>> BigFloat(1) # can be constructed from an integer, float or string\r\n BigFloat.exact('1.0000000000000000', precision=53)\r\n >>> BigFloat('3.14159') ** 2 / 6.0 # can combine with ints and floats\r\n BigFloat.exact('1.6449312880166664', precision=53)\r\n >>> BigFloat('0.1', precision(200)) # high-precision value from string\r\n BigFloat.exact('0.1000000000000000000000000000000000000000000000000000\r\n 0000000002', precision=200)\r\n\r\nNewly-created ``BigFloat`` instances refer to the current *context* to\r\ndetermine what precision and rounding modes to use. This current\r\ncontext is represented by a ``Context`` instance, and can be retrieved\r\nby calling ``getcontext``::\r\n\r\n >>> getcontext()\r\n Context(precision=53, emax=1073741823, emin=-1073741823,\r\n subnormalize=False, rounding=ROUND_TIES_TO_EVEN)\r\n\r\nThe ``precision(200)`` argument passed to the ``BigFloat`` constructor\r\nabove is also an example of a ``Context``::\r\n\r\n >>> precision(200)\r\n Context(precision=200)\r\n\r\nThe context used for a calculation can be set using the ``setcontext``\r\nfunction, but a better way to make a temporary change to the context\r\nis to use Python's ``with`` statement::\r\n\r\n >>> with precision(1000):\r\n ... print sqrt(2)\r\n ...\r\n 1.41421356237309504880168872420969807856967187537694807317667973\r\n 7990732478462107038850387534327641572735013846230912297024924836\r\n 0558507372126441214970999358314132226659275055927557999505011527\r\n 8206057147010955997160597027453459686201472851741864088919860955\r\n 232923048430871432145083976260362799525140798964\r\n\r\nHere, ``sqrt`` is one of a number of mathematical functions that the\r\n``bigfloat`` package exports. As you can see, these functions operate on\r\nintegers and floats as well as ``BigFloat`` instances, but always\r\nreturn a ``BigFloat`` instance.\r\n\r\nRounding modes can be controlled similarly. Here are upper and lower\r\nbounds for \u03c0, accurate to 53 significant bits::\r\n\r\n >>> with RoundTowardPositive:\r\n ... const_pi()\r\n ...\r\n BigFloat.exact('3.1415926535897936', precision=53)\r\n >>> with RoundTowardNegative:\r\n ... const_pi()\r\n ...\r\n BigFloat.exact('3.1415926535897931', precision=53)\r\n\r\nAnd as you'd expect, ``with`` statements like those above can be\r\nnested. ``Context`` objects can also be combined using addition::\r\n\r\n >>> with RoundTowardPositive + precision(24):\r\n ... BigFloat(1) / 3\r\n ...\r\n BigFloat.exact('0.333333343', precision=24)\r\n\r\nVarious ``Context`` objects corresponding to IEEE 754 interchange\r\nformats are predefined::\r\n\r\n >>> quadruple_precision\r\n Context(precision=113, emax=16384, emin=-16493, subnormalize=True)\r\n >>> half_precision\r\n Context(precision=11, emax=16, emin=-23, subnormalize=True)\r\n >>> with half_precision:\r\n log(2)\r\n ...\r\n BigFloat.exact('0.69336', precision=11)\r\n\r\nInstallation\r\n------------\r\n\r\nThe ``bigfloat`` package is `available on the Python package index\r\n`_, and can be installed in the usual\r\nway using ``easy_install`` or ``pip``. Alternatively, the development sources\r\nmay be downloaded from the project's `homepage\r\n`_ on GitHub.\r\n\r\nFor more comprehensive installation instructions, please see the `full\r\ndocumentation `_.\r\n\r\nFeedback\r\n--------\r\n\r\nFeedback is welcome! Please use the `GitHub issue tracker\r\n`_ to report issues.\r\nAlternatively, you can contact Mark Dickinson directly at dickinsm@gmail.com\r\nwith suggestions, complaints, bug reports, etc.\r\n\r\nLicense\r\n-------\r\n\r\nThe bigfloat package is copyright (C) 2009\u20132014 Mark Dickinson\r\n\r\nThe bigfloat package is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU Lesser General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or (at your\r\noption) any later version.\r\n\r\nThe bigfloat package is distributed in the hope that it will be useful, but\r\nWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r\nFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\r\nfor more details.\r\n\r\nYou should have received a copy of the GNU Lesser General Public License\r\nalong with the bigfloat package. If not, see .\r\n\r\nLinks\r\n-----\r\n- `Documentation at Read the Docs `_\r\n- `Python package index `_\r\n- `Project homepage at GitHub `_\r\n- `Issue tracker `_", "description_content_type": null, "docs_url": "https://pythonhosted.org/bigfloat/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mdickinson/bigfloat", "keywords": "", "license": "GNU Library or Lesser General Public License (LGPL)", "maintainer": "", "maintainer_email": "", "name": "bigfloat", "package_url": "https://pypi.org/project/bigfloat/", "platform": "Linux,OS X", "project_url": "https://pypi.org/project/bigfloat/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mdickinson/bigfloat" }, "release_url": "https://pypi.org/project/bigfloat/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Arbitrary-precision correctly-rounded floating-point arithmetic, via MPFR.", "version": "0.3.0" }, "last_serial": 2900954, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "fe666415f36d888a8fc4a0b2b80790aa", "sha256": "832bc46e568686682c1276686cc44faee07c174d68a4d55a53032e98c52a9829" }, "downloads": -1, "filename": "bigfloat-0.1.1.tar.gz", "has_sig": false, "md5_digest": "fe666415f36d888a8fc4a0b2b80790aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32306, "upload_time": "2009-10-10T23:44:37", "url": "https://files.pythonhosted.org/packages/5c/6f/50ff4c05a671bac92f6630b1f87802d30ef8ac9f4eab7f3511fd54b1a5eb/bigfloat-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "eff005ad0fbbb46a5a9549df9889b1f6", "sha256": "024f14be500cea9babeef8033ebeec818fbe64cb5fb66805bbdddf62c1ec56e8" }, "downloads": -1, "filename": "bigfloat-0.1.2.tar.gz", "has_sig": false, "md5_digest": "eff005ad0fbbb46a5a9549df9889b1f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102378, "upload_time": "2010-05-16T19:44:50", "url": "https://files.pythonhosted.org/packages/95/96/453ccfbda307df0ddfef6e4a59c31f3d0f4692fff7e54c357207ba3a1a92/bigfloat-0.1.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "5260728c060ce511b6e23018b76fc2e0", "sha256": "26ffdff7c3cd47489921cc8ed30a7f72752a434499baf30fa9b8213d862adf6b" }, "downloads": -1, "filename": "bigfloat-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5260728c060ce511b6e23018b76fc2e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 129540, "upload_time": "2010-08-20T18:15:26", "url": "https://files.pythonhosted.org/packages/0d/60/8bbaba333335c5ff3bb93ef06deb96199ffa5d2ddf4f9cb76c158b4ce06c/bigfloat-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "7343f72b02bad33676df57e10a13508a", "sha256": "262ebf31eaff44175dc52db7642f407a2acad3245bda1fdb30c4817d28c1a775" }, "downloads": -1, "filename": "bigfloat-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7343f72b02bad33676df57e10a13508a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216720, "upload_time": "2014-07-06T16:03:44", "url": "https://files.pythonhosted.org/packages/77/5c/ad7b6ff34308a15928728fd609980a0cc5c9df78d8f168dcf4996f9b0181/bigfloat-0.3.0.tar.gz" } ], "0.3.0a2": [ { "comment_text": "", "digests": { "md5": "d4384ec7aea0f8228185c9ea86c83f9a", "sha256": "1d6b052e302858eaf11fff107e198f70853dbcb70de420ae7c9173c6da17feb6" }, "downloads": -1, "filename": "bigfloat-0.3.0a2.tar.gz", "has_sig": false, "md5_digest": "d4384ec7aea0f8228185c9ea86c83f9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 439554, "upload_time": "2011-12-04T21:08:58", "url": "https://files.pythonhosted.org/packages/64/74/fecbaad34343a72de1be18a75dd04716ffc32ba9ada54470ebede7321c7c/bigfloat-0.3.0a2.tar.gz" } ], "0.3.0b1": [ { "comment_text": "", "digests": { "md5": "0678588c0e9a9b7cc9add1d32f2a8cb3", "sha256": "332a3e33f4ecc4db35815dceaad1186948c35f1ce4796a21c56fdcd627185673" }, "downloads": -1, "filename": "bigfloat-0.3.0b1.tar.gz", "has_sig": false, "md5_digest": "0678588c0e9a9b7cc9add1d32f2a8cb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 213207, "upload_time": "2014-07-05T14:48:58", "url": "https://files.pythonhosted.org/packages/d6/47/7a8ee2e2786a246670f5ed37ea0d03f37b22cd04ea45dd0b84c53869b613/bigfloat-0.3.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7343f72b02bad33676df57e10a13508a", "sha256": "262ebf31eaff44175dc52db7642f407a2acad3245bda1fdb30c4817d28c1a775" }, "downloads": -1, "filename": "bigfloat-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7343f72b02bad33676df57e10a13508a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216720, "upload_time": "2014-07-06T16:03:44", "url": "https://files.pythonhosted.org/packages/77/5c/ad7b6ff34308a15928728fd609980a0cc5c9df78d8f168dcf4996f9b0181/bigfloat-0.3.0.tar.gz" } ] }