cosmopolitan/third_party/python/Modules/_decimal/libmpdec
Justine Tunney 47a53e143b Productionize new APE loader and more
The APE_NO_MODIFY_SELF loader payload has been moved out of the examples
folder and improved so that it works on BSD systems, and permits general
elf program headers. This brings its quality up enough that it should be
acceptable to use by default for many programs, e.g. Python, Lua, SQLite
and Python. It's the responsibility of the user to define an appropriate
TMPDIR if /tmp is considered an adversarial environment. Mac OS shall be
supported by APE_NO_MODIFY_SELF soon.

Fixes and improvements have been made to program_executable_name as it's
now the one true way to get the absolute path of the executing image.

This change fixes a memory leak in linenoise history loading, introduced
by performance optimizations in 51904e2687
This change fixes a longstanding regression with Mach system calls, that
23ae9dfceb back in February which impacted
our sched_yield() implementation, which is why no one noticed until now.

The Blinkenlights PC emulator has been improved. We now fix rendering on
XNU and BSD by not making the assumption that the kernel terminal driver
understands UTF8 since that seems to break its internal modeling of \r\n
which is now being addressed by using \e[𝑦H instead. The paneling is now
more compact in real mode so you won't need to make your font as tiny if
you're only emulating an 8086 program. The CLMUL ISA is now emulated too

This change also makes improvement to time. CLOCK_MONOTONIC now does the
right thing on Windows NT. The nanosecond time module functions added in
Python 3.7 have been backported.

This change doubles the performance of Argon2 password stretching simply
by not using its copy_block and xor_block helper functions, as they were
trivial to inline thus resulting in us needing to iterate over each 1024
byte block four fewer times.

This change makes code size improvements. _PyUnicode_ToNumeric() was 64k
in size and now it's 10k. The CJK codec lookup tables now use lazy delta
zigzag deflate (δzd) encoding which reduces their size from 600k to 200k
plus the code bloat caused by macro abuse in _decimal.c is now addressed
so our fully-loaded statically-linked hermetically-sealed Python virtual
interpreter container is now 9.4 megs in the default build mode and 5.5m
in MODE=tiny which leaves plenty of room for chibicc.

The pydoc web server now accommodates the use case of people who work by
SSH'ing into a different machine w/ python.com -m pydoc -p8080 -h0.0.0.0

Finally Python Capsulae delenda est and won't be supported in the future
2021-10-02 08:27:03 -07:00
..
basearith.c Make numerous improvements 2021-09-28 01:52:34 -07:00
basearith.h Make numerous improvements 2021-09-28 01:52:34 -07:00
bits.h Make numerous improvements 2021-09-28 01:52:34 -07:00
constants.c Make numerous improvements 2021-09-28 01:52:34 -07:00
constants.h Make numerous improvements 2021-09-28 01:52:34 -07:00
context.c Make numerous improvements 2021-09-28 01:52:34 -07:00
convolute.c Make numerous improvements 2021-09-28 01:52:34 -07:00
convolute.h Make numerous improvements 2021-09-28 01:52:34 -07:00
crt.c Make numerous improvements 2021-09-28 01:52:34 -07:00
crt.h Make numerous improvements 2021-09-28 01:52:34 -07:00
difradix2.c Make numerous improvements 2021-09-28 01:52:34 -07:00
difradix2.h Make numerous improvements 2021-09-28 01:52:34 -07:00
fnt.c Make numerous improvements 2021-09-28 01:52:34 -07:00
fnt.h Make numerous improvements 2021-09-28 01:52:34 -07:00
fourstep.c Make numerous improvements 2021-09-28 01:52:34 -07:00
fourstep.h Make numerous improvements 2021-09-28 01:52:34 -07:00
io.c Make numerous improvements 2021-09-28 01:52:34 -07:00
io.h Undiamond Python headers 2021-08-12 14:07:40 -07:00
memory.c Make whitespace changes 2021-08-13 03:20:45 -07:00
mpalloc.h Make numerous improvements 2021-09-28 01:52:34 -07:00
mpdecimal.c Make numerous improvements 2021-09-28 01:52:34 -07:00
mpdecimal.h Make numerous improvements 2021-09-28 01:52:34 -07:00
numbertheory.c Make numerous improvements 2021-09-28 01:52:34 -07:00
numbertheory.h Make numerous improvements 2021-09-28 01:52:34 -07:00
README.txt python-3.6.zip added from Github 2021-08-09 05:39:42 -07:00
sixstep.c Make numerous improvements 2021-09-28 01:52:34 -07:00
sixstep.h Make numerous improvements 2021-09-28 01:52:34 -07:00
transpose.c Productionize new APE loader and more 2021-10-02 08:27:03 -07:00
transpose.h Make numerous improvements 2021-09-28 01:52:34 -07:00
typearith.h Make numerous improvements 2021-09-28 01:52:34 -07:00
umodarith.h Make numerous improvements 2021-09-28 01:52:34 -07:00


libmpdec
========

libmpdec is a fast C/C++ library for correctly-rounded arbitrary precision
decimal floating point arithmetic. It is a complete implementation of
Mike Cowlishaw/IBM's General Decimal Arithmetic Specification.


Files required for the Python _decimal module
=============================================

  Core files for small and medium precision arithmetic
  ----------------------------------------------------

    basearith.{c,h}  ->  Core arithmetic in base 10**9 or 10**19.
    bits.h           ->  Portable detection of least/most significant one-bit.
    constants.{c,h}  ->  Constants that are used in multiple files.
    context.c        ->  Context functions.
    io.{c,h}         ->  Conversions between mpd_t and ASCII strings,
                         mpd_t formatting (allows UTF-8 fill character).
    memory.{c,h}     ->  Allocation handlers with overflow detection
                         and functions for switching between static
                         and dynamic mpd_t.
    mpdecimal.{c,h}  ->  All (quiet) functions of the specification.
    typearith.h      ->  Fast primitives for double word multiplication,
                         division etc.

    Visual Studio only:
    ~~~~~~~~~~~~~~~~~~~
      vccompat.h    ->  snprintf <==> sprintf_s and similar things.
      vcstdint.h    ->  stdint.h (included in VS 2010 but not in VS 2008).
      vcdiv64.asm   ->  Double word division used in typearith.h. VS 2008 does
                        not allow inline asm for x64. Also, it does not provide
                        an intrinsic for double word division.

  Files for bignum arithmetic:
  ----------------------------

    The following files implement the Fast Number Theoretic Transform
    used for multiplying coefficients with more than 1024 words (see
    mpdecimal.c: _mpd_fntmul()).

      umodarith.h        ->  Fast low level routines for unsigned modular arithmetic.
      numbertheory.{c,h} ->  Routines for setting up the Number Theoretic Transform.
      difradix2.{c,h}    ->  Decimation in frequency transform, used as the
                             "base case" by the following three files:

        fnt.{c,h}        ->  Transform arrays up to 4096 words.
        sixstep.{c,h}    ->  Transform larger arrays of length 2**n.
        fourstep.{c,h}   ->  Transform larger arrays of length 3 * 2**n.

      convolute.{c,h}    ->  Fast convolution using one of the three transform
                             functions.
      transpose.{c,h}    ->  Transpositions needed for the sixstep algorithm.
      crt.{c,h}          ->  Chinese Remainder Theorem: use information from three
                             transforms modulo three different primes to get the
                             final result.


Pointers to literature, proofs and more
=======================================

  literature/
  -----------

    REFERENCES.txt  ->  List of relevant papers.
    bignum.txt      ->  Explanation of the Fast Number Theoretic Transform (FNT).
    fnt.py          ->  Verify constants used in the FNT; Python demo for the
                        O(N**2) discrete transform.

    matrix-transform.txt -> Proof for the Matrix Fourier Transform used in
                            fourstep.c.
    six-step.txt         -> Show that the algorithm used in sixstep.c is
                            a variant of the Matrix Fourier Transform.
    mulmod-64.txt        -> Proof for the mulmod64 algorithm from
                            umodarith.h.
    mulmod-ppro.txt      -> Proof for the x87 FPU modular multiplication
                            from umodarith.h.
    umodarith.lisp       -> ACL2 proofs for many functions from umodarith.h.


Library Author
==============

  Stefan Krah <skrah@bytereef.org>