/external/python/cpython3/Lib/test/ |
D | test_decimal.py | 11 These are the test cases for the Decimal module. 14 the Decimal arithmetic using the tests provided by Mike Cowlishaw. The latter 19 http://speleotrove.com/decimal/dectest.zip 44 C = import_fresh_module('decimal', fresh=['_decimal']) 45 P = import_fresh_module('decimal', blocked=['_decimal']) 46 orig_sys_decimal = sys.modules['decimal'] 48 # fractions module must import the correct decimal module. 50 sys.modules['decimal'] = P 52 sys.modules['decimal'] = C 54 sys.modules['decimal'] = orig_sys_decimal [all …]
|
D | test_statistics.py | 8 import decimal 15 from decimal import Decimal 32 >>> _nan_equal(Decimal('NAN'), Decimal('NAN')) 34 >>> _nan_equal(Decimal('sNAN'), Decimal('sNAN')) 36 >>> _nan_equal(Decimal('NAN'), Decimal('sNAN')) 38 >>> _nan_equal(Decimal(42), Decimal('NAN')) 46 >>> _nan_equal(float('NAN'), Decimal('NAN')) 295 args1 = [2456, 37.8, -12.45, Decimal('2.54'), Fraction(17, 54)] 296 args2 = [2459, 37.2, -12.41, Decimal('2.59'), Fraction(15, 54)] 318 for type_ in (int, float, Decimal, Fraction): [all …]
|
/external/python/cpython2/Lib/test/ |
D | test_decimal.py | 11 These are the test cases for the Decimal module. 14 the Decimal arithmetic using the tests provided by Mike Cowlishaw. The latter 19 http://speleotrove.com/decimal/dectest.zip 32 from decimal import * 91 # Decimal behaves differently from decNumber for these testcases so these 149 # Name adapter to be able to change the Decimal and Context 190 # The following functions return True/False rather than a Decimal instance 207 """Class which tests the Decimal class against the test cases. 337 v = Decimal(v, self.context) 410 # The following classes test the behaviour of Decimal according to PEP 327 [all …]
|
/external/python/cpython3/Lib/ |
D | _pydecimal.py | 17 This is an implementation of decimal floating point arithmetic based on 18 the General Decimal Arithmetic Specification: 20 http://speleotrove.com/decimal/decarith.html 26 Decimal floating point has finite precision with arbitrarily large bounds. 34 of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected 35 Decimal('0.00')). 37 Here are some examples of using the decimal module: 39 >>> from decimal import * 41 >>> Decimal(0) 42 Decimal('0') [all …]
|
/external/python/cpython2/Doc/library/ |
D | decimal.rst | 2 :mod:`decimal` --- Decimal fixed point and floating point arithmetic 5 .. module:: decimal 6 :synopsis: Implementation of the General Decimal Arithmetic Specification. 23 import decimal 25 from decimal import * 29 The :mod:`decimal` module provides support for decimal floating point 32 * Decimal "is based on a floating-point model which was designed with people 35 people learn at school." -- excerpt from the decimal arithmetic specification. 37 * Decimal numbers can be represented exactly. In contrast, numbers like 42 * The exactness carries over into arithmetic. In decimal floating point, ``0.1 [all …]
|
D | fractions.rst | 23 Fraction(decimal) 32 either a :class:`float` or a :class:`decimal.Decimal` instance, and return a 45 decimal digits. In addition, any string that represents a finite 72 >>> from decimal import Decimal 73 >>> Fraction(Decimal('1.1')) 85 :class:`decimal.Decimal` instances. 101 value of *dec*, which must be a :class:`decimal.Decimal`. 104 :class:`Fraction` instance directly from a :class:`decimal.Decimal`
|
/external/python/cpython2/Lib/ |
D | decimal.py | 21 This is a Py2.3 implementation of decimal floating point arithmetic based on 22 the General Decimal Arithmetic Specification: 24 http://speleotrove.com/decimal/decarith.html 30 Decimal floating point has finite precision with arbitrarily large bounds. 38 of the expected Decimal('0.00') returned by decimal floating point). 40 Here are some examples of using the decimal module: 42 >>> from decimal import * 44 >>> Decimal(0) 45 Decimal('0') 46 >>> Decimal('1') [all …]
|
/external/python/cpython3/Doc/library/ |
D | decimal.rst | 1 :mod:`decimal` --- Decimal fixed point and floating point arithmetic 4 .. module:: decimal 5 :synopsis: Implementation of the General Decimal Arithmetic Specification. 15 **Source code:** :source:`Lib/decimal.py` 20 import decimal 22 from decimal import * 33 The :mod:`decimal` module provides support for fast correctly-rounded 34 decimal floating point arithmetic. It offers several advantages over the 37 * Decimal "is based on a floating-point model which was designed with people 40 people learn at school." -- excerpt from the decimal arithmetic specification. [all …]
|
D | fractions.rst | 23 Fraction(decimal) 32 either a :class:`float` or a :class:`decimal.Decimal` instance, and return a 45 decimal digits. In addition, any string that represents a finite 72 >>> from decimal import Decimal 73 >>> Fraction(Decimal('1.1')) 85 :class:`decimal.Decimal` instances. 112 value of *dec*, which must be a :class:`decimal.Decimal` instance. 117 :class:`Fraction` instance directly from a :class:`decimal.Decimal`
|
/external/cldr/common/supplemental/ |
D | plurals.xml | 16 …<pluralRule count="other"> @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 1… 22 … <pluralRule count="one">i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04</pluralRule> 23 …<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 1… 26 <pluralRule count="one">i = 0,1 @integer 0, 1 @decimal 0.0~1.5</pluralRule> 27 …<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 1… 30 <pluralRule count="one">i = 0..1 @integer 0, 1 @decimal 0.0~1.5</pluralRule> 31 …<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 1… 35 …e count="other"> @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 10… 38 …<pluralRule count="one">n = 0,1 or i = 0 and f = 1 @integer 0, 1 @decimal 0.0, 0.1, 1.0, 0.00, 0.0… 39 …<pluralRule count="other"> @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.2~0.9, 1… [all …]
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/asn1/ |
D | BERTags.java | 12 public static final int ENUMERATED = 0x0a; // decimal 10 13 public static final int SEQUENCE = 0x10; // decimal 16 15 public static final int SET = 0x11; // decimal 17 19 public static final int NUMERIC_STRING = 0x12; // decimal 18 20 public static final int PRINTABLE_STRING = 0x13; // decimal 19 21 public static final int T61_STRING = 0x14; // decimal 20 22 public static final int VIDEOTEX_STRING = 0x15; // decimal 21 23 public static final int IA5_STRING = 0x16; // decimal 22 24 public static final int UTC_TIME = 0x17; // decimal 23 25 public static final int GENERALIZED_TIME = 0x18; // decimal 24 [all …]
|
/external/bouncycastle/repackaged/bcprov/src/main/java/com/android/org/bouncycastle/asn1/ |
D | BERTags.java | 16 public static final int ENUMERATED = 0x0a; // decimal 10 17 public static final int SEQUENCE = 0x10; // decimal 16 19 public static final int SET = 0x11; // decimal 17 23 public static final int NUMERIC_STRING = 0x12; // decimal 18 24 public static final int PRINTABLE_STRING = 0x13; // decimal 19 25 public static final int T61_STRING = 0x14; // decimal 20 26 public static final int VIDEOTEX_STRING = 0x15; // decimal 21 27 public static final int IA5_STRING = 0x16; // decimal 22 28 public static final int UTC_TIME = 0x17; // decimal 23 29 public static final int GENERALIZED_TIME = 0x18; // decimal 24 [all …]
|
/external/icu/icu4c/source/data/misc/ |
D | plurals.txt | 314 " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1." 319 one{"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"} 321 " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2." 328 " 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1~1.6, 10.1, 100.1, 100" 332 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0" 340 "11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1" 344 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0" 353 "00, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1" 358 " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0." 366 "101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 1" [all …]
|
/external/python/cpython2/Doc/tutorial/ |
D | floatingpoint.rst | 11 fractions. For example, the decimal fraction :: 23 Unfortunately, most decimal fractions cannot be represented exactly as binary 24 fractions. A consequence is that, in general, the decimal floating-point 46 decimal value 0.1 cannot be represented exactly as a base 2 fraction. In base 54 for a Python float, so the value stored internally when you enter the decimal 62 decimal fraction, because of the way that floats are displayed at the 63 interpreter prompt. Python only prints a decimal approximation to the true 64 decimal value of the binary approximation stored by the machine. If Python 65 were to print the true decimal value of the binary approximation stored for 92 value 2.675 to two decimal places, you get this :: [all …]
|
D | stdlib2.rst | 350 .. _tut-decimal-fp: 352 Decimal Floating Point Arithmetic 355 The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for 356 decimal floating point arithmetic. Compared to the built-in :class:`float` 359 * financial applications and other uses which require exact decimal 363 * tracking of significant decimal places, or 368 results in decimal floating point and binary floating point. The difference 371 >>> from decimal import * 372 >>> x = Decimal('0.70') * Decimal('1.05') 374 Decimal('0.7350') [all …]
|
/external/apache-xml/src/main/java/org/apache/xalan/templates/ |
D | DecimalFormatProperties.java | 28 * Implement xsl:decimal-format. 30 * <!ELEMENT xsl:decimal-format EMPTY> 31 * <!ATTLIST xsl:decimal-format 33 * decimal-separator %char; "." 73 * Return the decimal format Symbols for this element. 74 * <p>The xsl:decimal-format element declares a decimal-format, 77 * the element declares a named decimal-format; otherwise, it 78 * declares the default decimal-format. The value of the name 80 * It is an error to declare either the default decimal-format or a 81 * decimal-format with a given name more than once (even with different [all …]
|
/external/python/cpython3/Lib/test/test_asyncio/ |
D | test_context.py | 2 import decimal 10 with decimal.localcontext() as ctx: 12 a = decimal.Decimal(x) / decimal.Decimal(y) 14 b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
|
/external/parameter-framework/upstream/test/test-fixed-point-parameter/ |
D | Main.py | 34 from decimal import Decimal 83 Decimal(0), 84 Decimal(self._lowerAllowedBound), 85 Decimal(self._upperAllowedBound) 93 Decimal(self._lowerAllowedBound) - Decimal(bigValue), 94 Decimal(self._upperAllowedBound) + Decimal(bigValue), 95 Decimal(self._lowerAllowedBound) - Decimal(littleValue), 96 Decimal(self._upperAllowedBound) + Decimal(littleValue) 159 returnValue = Decimal(firstGet) 161 print("ERROR: Can't convert %s to a decimal" % firstGet) [all …]
|
/external/python/cpython3/Modules/_decimal/ |
D | docstrings.h | 20 "C decimal arithmetic module"); 52 /* Decimal Object and Methods */ 56 "Decimal(value=\"0\", context=None)\n--\n\n\ 57 Construct a new Decimal object. 'value' can be an integer, string, tuple,\n\ 58 or another Decimal object. If no value is given, return Decimal('0'). The\n\ 75 Decimal.as_integer_ratio() -> (int, int)\n\ 78 Decimal and with a positive denominator. The ratio is in lowest terms.\n\ 85 of a Decimal instance is always canonical, so this operation returns its\n\ 91 Compare self to other. Return a decimal value:\n\ 93 a or b is a NaN ==> Decimal('NaN')\n\ [all …]
|
/external/python/cpython3/Doc/tutorial/ |
D | floatingpoint.rst | 15 fractions. For example, the decimal fraction :: 27 Unfortunately, most decimal fractions cannot be represented exactly as binary 28 fractions. A consequence is that, in general, the decimal floating-point 50 decimal value 0.1 cannot be represented exactly as a base 2 fraction. In base 63 displayed. Python only prints a decimal approximation to the true decimal 65 Python were to print the true decimal value of the binary approximation stored 80 Interestingly, there are many different decimal numbers that share the same 84 approximated by ``3602879701896397 / 2 ** 55``. Since all of these decimal 143 tasks, but you do need to keep in mind that it's not decimal arithmetic and 148 display of your final results to the number of decimal digits you expect. [all …]
|
D | stdlib2.rst | 352 .. _tut-decimal-fp: 354 Decimal Floating Point Arithmetic 357 The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for 358 decimal floating point arithmetic. Compared to the built-in :class:`float` 361 * financial applications and other uses which require exact decimal 365 * tracking of significant decimal places, or 370 results in decimal floating point and binary floating point. The difference 373 >>> from decimal import * 374 >>> round(Decimal('0.70') * Decimal('1.05'), 2) 375 Decimal('0.74') [all …]
|
/external/python/cpython2/Doc/whatsnew/ |
D | 2.4.rst | 471 PEP 327: Decimal Data Type 477 unaware that floating-point numbers don't represent certain decimal fractions 478 accurately. The new :class:`Decimal` type can represent these fractions 482 Why is Decimal needed? 492 decimal notation. 494 * The exponent, which tells where the decimal point is located in the number 498 binary), and an exponent of 0 (the decimal point doesn't need to be shifted). 510 For example, 1.1 decimal is binary ``1.0001100110011 ...``; .1 = 1/16 + 1/32 + 512 that infinitely repeated decimal after 52 digits, so the representation is 521 FP-to-decimal-string conversion is provided by the C library, and most C libraries try [all …]
|
/external/python/cpython3/Doc/whatsnew/ |
D | 2.4.rst | 471 PEP 327: Decimal Data Type 477 unaware that floating-point numbers don't represent certain decimal fractions 478 accurately. The new :class:`Decimal` type can represent these fractions 482 Why is Decimal needed? 492 decimal notation. 494 * The exponent, which tells where the decimal point is located in the number 498 binary), and an exponent of 0 (the decimal point doesn't need to be shifted). 510 For example, 1.1 decimal is binary ``1.0001100110011 ...``; .1 = 1/16 + 1/32 + 512 that infinitely repeated decimal after 52 digits, so the representation is 521 FP-to-decimal-string conversion is provided by the C library, and most C libraries try [all …]
|
/external/libxml2/result/schemas/ |
D | decimal-1_1_0.err | 1 ./test/schemas/decimal-1_0.xml:16: element val: Schemas validity error : Element 'val': '.' is not … 2 ./test/schemas/decimal-1_0.xml:17: element val: Schemas validity error : Element 'val': '-' is not … 3 ./test/schemas/decimal-1_0.xml:18: element val: Schemas validity error : Element 'val': '+' is not … 4 ./test/schemas/decimal-1_0.xml:19: element val: Schemas validity error : Element 'val': '*' is not … 5 ./test/schemas/decimal-1_0.xml:20: element val: Schemas validity error : Element 'val': '- 1' is no… 6 ./test/schemas/decimal-1_0.xml:21: element val: Schemas validity error : Element 'val': '+ 1' is no… 7 ./test/schemas/decimal-1_0.xml:22: element val: Schemas validity error : Element 'val': '+ 0' is no… 8 ./test/schemas/decimal-1_0.xml:23: element val: Schemas validity error : Element 'val': '- 0' is no…
|
D | decimal-3_1_0.err | 1 ./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'tot… 2 ./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': '0.123' is … 3 ./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'tot… 4 ./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': '0.023' is … 5 ./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': [facet 'tot… 6 ./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': '123' is no… 7 ./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': [facet 'tot… 8 ./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': '12.3' is n…
|