forked from AFPy/python-docs-fr
213 lines
5.9 KiB
Plaintext
213 lines
5.9 KiB
Plaintext
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 2001-2021, Python Software Foundation
|
|
# This file is distributed under the same license as the Python package.
|
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
#
|
|
#, fuzzy
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 3.10\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2021-03-18 17:40+0100\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: c-api/decimal.rst:7
|
|
msgid "Decimal capsule API"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:9
|
|
msgid ""
|
|
"Capsule API functions can be used in the same manner as regular library "
|
|
"functions, provided that the API has been initialized."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:14
|
|
msgid "Initialize"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:16
|
|
msgid ""
|
|
"Typically, a C extension module that uses the decimal API will do these "
|
|
"steps in its init function:"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:34
|
|
msgid "Type checking, predicates, accessors"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:38
|
|
msgid ""
|
|
"Return 1 if ``dec`` is a Decimal, 0 otherwise. This function does not set "
|
|
"any exceptions."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:44
|
|
msgid "Return 1 if ``dec`` is ``NaN``, ``sNaN`` or ``Infinity``, 0 otherwise."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:55 c-api/decimal.rst:64
|
|
msgid ""
|
|
"Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed "
|
|
"that this is the only failure mode, so if ``dec`` has already been type-"
|
|
"checked, no errors can occur and the function can be treated as a simple "
|
|
"predicate."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:53
|
|
msgid "Return 1 if ``dec`` is ``NaN`` or ``sNaN``, 0 otherwise."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:62
|
|
msgid "Return 1 if ``dec`` is ``Infinity``, 0 otherwise."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:71
|
|
msgid ""
|
|
"Return the number of digits in the coefficient. For ``Infinity``, the "
|
|
"number of digits is always zero. Typically, the same applies to ``NaN`` and "
|
|
"``sNaN``, but both of these can have a payload that is equivalent to a "
|
|
"coefficient. Therefore, ``NaNs`` can have a nonzero return value."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:76
|
|
msgid ""
|
|
"Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed "
|
|
"that this is the only failure mode, so if ``dec`` has already been type-"
|
|
"checked, no errors can occur and the function can be treated as a simple "
|
|
"accessor."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:82
|
|
msgid "Exact conversions between decimals and primitive C types"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:84
|
|
msgid ""
|
|
"This API supports conversions for decimals with a coefficient up to 38 "
|
|
"digits."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:87
|
|
msgid "Data structures"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:89
|
|
msgid ""
|
|
"The conversion functions use the following status codes and data structures:"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:110
|
|
msgid ""
|
|
"The status cases are explained below. ``sign`` is 0 for positive and 1 for "
|
|
"negative. ``((uint128_t)hi << 64) + lo`` is the coefficient, ``exp`` is the "
|
|
"exponent."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:113
|
|
msgid ""
|
|
"The data structure is called \"triple\" because the decimal triple (sign, "
|
|
"coeff, exp) is an established term and (``hi``, ``lo``) represents a single "
|
|
"``uint128_t`` coefficient."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:216
|
|
msgid "Functions"
|
|
msgstr "Fonctions"
|
|
|
|
#: c-api/decimal.rst:122
|
|
msgid ""
|
|
"Convert a decimal to a triple. As above, it is guaranteed that the only "
|
|
"Python failure mode is a TypeError, checks can be omitted if the type is "
|
|
"known."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:126
|
|
msgid ""
|
|
"For simplicity, the usage of the function and all special cases are "
|
|
"explained in code form and comments:"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:180
|
|
msgid ""
|
|
"Create a decimal from a triple. The following rules must be observed for "
|
|
"initializing the triple:"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:183
|
|
msgid "``triple.sign`` must always be 0 (for positive) or 1 (for negative)."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:185
|
|
msgid ""
|
|
"``MPD_TRIPLE_QNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple."
|
|
"lo`` are nonzero, create a ``NaN`` with a payload."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:188
|
|
msgid ""
|
|
"``MPD_TRIPLE_SNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple."
|
|
"lo`` are nonzero, create an ``sNaN`` with a payload."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:191
|
|
msgid ""
|
|
"``MPD_TRIPLE_INF``: ``triple.exp``, ``triple.hi`` and ``triple.lo`` must be "
|
|
"zero."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:193
|
|
msgid ""
|
|
"``MPD_TRIPLE_NORMAL``: ``MPD_MIN_ETINY + 38 < triple.exp < MPD_MAX_EMAX - "
|
|
"38``. ``triple.hi`` and ``triple.lo`` can be chosen freely."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:196
|
|
msgid "``MPD_TRIPLE_ERROR``: It is always an error to set this tag."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:199
|
|
msgid ""
|
|
"If one of the above conditions is not met, the function returns ``NaN`` if "
|
|
"the ``InvalidOperation`` trap is not set in the thread local context. "
|
|
"Otherwise, it sets the ``InvalidOperation`` exception and returns NULL."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:203
|
|
msgid ""
|
|
"Additionally, though extremely unlikely give the small allocation sizes, the "
|
|
"function can set ``MemoryError`` and return ``NULL``."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:208
|
|
msgid "Advanced API"
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:210
|
|
msgid ""
|
|
"This API enables the use of ``libmpdec`` functions. Since Python is "
|
|
"compiled with hidden symbols, the API requires an external libmpdec and the "
|
|
"``mpdecimal.h`` header."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:220
|
|
msgid ""
|
|
"Return a new decimal that can be used in the ``result`` position of "
|
|
"``libmpdec`` functions."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:225
|
|
msgid ""
|
|
"Get a pointer to the internal ``mpd_t`` of the decimal. Decimals are "
|
|
"immutable, so this function must only be used on a new Decimal that has been "
|
|
"created by PyDec_Alloc()."
|
|
msgstr ""
|
|
|
|
#: c-api/decimal.rst:231
|
|
msgid "Get a pointer to the constant internal ``mpd_t`` of the decimal."
|
|
msgstr ""
|