Home
last modified time | relevance | path

Searched full:decimal (Results 1 – 25 of 2307) sorted by relevance

12345678910>>...93

/third_party/python/Lib/test/
Dtest_decimal.py11 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
63 C = import_fresh_module('decimal', fresh=['_decimal'])
64 P = import_fresh_module('decimal', blocked=['_decimal'])
65 import decimal as orig_sys_decimal
67 # fractions module must import the correct decimal module.
69 sys.modules['decimal'] = P
71 sys.modules['decimal'] = C
73 sys.modules['decimal'] = orig_sys_decimal
[all …]
Dtest_statistics.py10 import decimal
20 from decimal import Decimal
37 >>> _nan_equal(Decimal('NAN'), Decimal('NAN'))
39 >>> _nan_equal(Decimal('sNAN'), Decimal('sNAN'))
41 >>> _nan_equal(Decimal('NAN'), Decimal('sNAN'))
43 >>> _nan_equal(Decimal(42), Decimal('NAN'))
51 >>> _nan_equal(float('NAN'), Decimal('NAN'))
319 args1 = [2456, 37.8, -12.45, Decimal('2.54'), Fraction(17, 54)]
320 args2 = [2459, 37.2, -12.41, Decimal('2.59'), Fraction(15, 54)]
342 for type_ in (int, float, Decimal, Fraction):
[all …]
/third_party/python/Lib/
D_pydecimal.py17 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 …]
/third_party/python/Doc/library/
Ddecimal.rst1 :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 …]
Dfractions.rst23 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.
123 value of *dec*, which must be a :class:`decimal.Decimal` instance.
128 :class:`Fraction` instance directly from a :class:`decimal.Decimal`
/third_party/icu/icu4c/source/data/misc/
Dplurals.txt335 " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1."
340 one{"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"}
342 " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2."
349 "11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1"
353 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0"
362 "00, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1"
367 " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0."
375 "101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 1"
379 " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, "
390 one{"i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6"}
[all …]
/third_party/skia/third_party/externals/icu/source/data/misc/
Dplurals.txt327 " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1."
332 one{"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"}
334 " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2."
341 " 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1~1.6, 10.1, 100.1, 100"
345 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0"
353 "11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1"
357 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0"
366 "00, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1"
371 " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0."
379 "101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 1"
[all …]
/third_party/python/Lib/test/test_asyncio/
Dtest_context.py2 import decimal
10 @unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
15 with decimal.localcontext() as ctx:
17 a = decimal.Decimal(x) / decimal.Decimal(y)
19 b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
/third_party/tzdata/
Dnewstrftime.3.txt38 to an integer) as a decimal number [00,99].
45 %d is replaced by the day of the month as a decimal number [01,31].
47 %e is replaced by the day of month as a decimal number [1,31];
52 %G is replaced by the ISO 8601 year with century as a decimal
55 %g is replaced by the ISO 8601 year without century as a decimal
60 %H is replaced by the hour (24-hour clock) as a decimal number
63 %I is replaced by the hour (12-hour clock) as a decimal number
66 %j is replaced by the day of the year as a decimal number
69 %k is replaced by the hour (24-hour clock) as a decimal number
72 %l is replaced by the hour (12-hour clock) as a decimal number
[all …]
Dnewstrftime.3103 as a decimal number [00,99].
113 is replaced by the day of the month as a decimal number [01,31].
116 is replaced by the day of month as a decimal number [1,31];
125 is replaced by the ISO 8601 year with century as a decimal number.
131 is replaced by the ISO 8601 year without century as a decimal number [00,99].
139 is replaced by the hour (24-hour clock) as a decimal number [00,23].
142 is replaced by the hour (12-hour clock) as a decimal number [01,12].
145 is replaced by the day of the year as a decimal number [001,366].
148 is replaced by the hour (24-hour clock) as a decimal number [0,23];
152 is replaced by the hour (12-hour clock) as a decimal number [1,12];
[all …]
/third_party/python/Modules/_decimal/
Ddocstrings.h20 "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 …]
/third_party/python/Doc/tutorial/
Dfloatingpoint.rst15 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 …]
Dstdlib2.rst352 .. _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 …]
/third_party/python/Doc/whatsnew/
D2.4.rst471 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 …]
/third_party/icu/icu4c/source/i18n/
Ddouble-conversion-double-to-string.h104 // converted into decimal format then a trailing decimal point is appended.
106 // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point
124 // represent input numbers in decimal format if they are in the interval
194 // (see constructor) it then either returns a decimal representation, or an
223 // (Sign, '0', decimal point, padding zeroes for decimal_in_shortest_low,
240 // Computes a decimal representation with a fixed number of digits after the
241 // decimal point. The last emitted digit is rounded.
273 // (one additional character for the sign, and one for the decimal point).
280 // after the decimal point. The last emitted digit is rounded.
306 // decimal point, the decimal point, the exponent character, the
[all …]
/third_party/node/deps/icu-small/source/i18n/
Ddouble-conversion-double-to-string.h104 // converted into decimal format then a trailing decimal point is appended.
106 // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point
124 // represent input numbers in decimal format if they are in the interval
194 // (see constructor) it then either returns a decimal representation, or an
223 // (Sign, '0', decimal point, padding zeroes for decimal_in_shortest_low,
240 // Computes a decimal representation with a fixed number of digits after the
241 // decimal point. The last emitted digit is rounded.
273 // (one additional character for the sign, and one for the decimal point).
280 // after the decimal point. The last emitted digit is rounded.
306 // decimal point, the decimal point, the exponent character, the
[all …]
/third_party/icu/vendor/double-conversion/upstream/double-conversion/
Ddouble-to-string.h89 // converted into decimal format then a trailing decimal point is appended.
91 // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point
109 // represent input numbers in decimal format if they are in the interval
179 // (see constructor) it then either returns a decimal representation, or an
208 // (Sign, '0', decimal point, padding zeroes for decimal_in_shortest_low,
225 // Computes a decimal representation with a fixed number of digits after the
226 // decimal point. The last emitted digit is rounded.
258 // (one additional character for the sign, and one for the decimal point).
265 // after the decimal point. The last emitted digit is rounded.
291 // decimal point, the decimal point, the exponent character, the
[all …]
/third_party/skia/third_party/externals/icu/source/i18n/
Ddouble-conversion-double-to-string.h104 // converted into decimal format then a trailing decimal point is appended.
106 // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point
124 // represent input numbers in decimal format if they are in the interval
194 // (see constructor) it then either returns a decimal representation, or an
223 // (Sign, '0', decimal point, padding zeroes for decimal_in_shortest_low,
240 // Computes a decimal representation with a fixed number of digits after the
241 // decimal point. The last emitted digit is rounded.
273 // (one additional character for the sign, and one for the decimal point).
280 // after the decimal point. The last emitted digit is rounded.
306 // decimal point, the decimal point, the exponent character, the
[all …]
/third_party/python/Modules/_decimal/tests/
Ddeccheck.py56 C = import_fresh_module('decimal', fresh=['_decimal'])
57 P = import_fresh_module('decimal', blocked=['_decimal'])
61 # Contains all categories of Decimal methods.
107 # applies to the number of Decimal arguments.
300 # context values. We emulate this restriction for decimal.py.
361 self.cop = RestrictedList() # converted C.Decimal operands
362 self.cex = RestrictedList() # Python exceptions for C.Decimal
363 self.cresults = RestrictedList() # C.Decimal results
364 self.pop = RestrictedList() # converted P.Decimal operands
365 self.pex = RestrictedList() # Python exceptions for P.Decimal
[all …]
Dbench.py12 C = import_fresh_module('decimal', fresh=['_decimal'])
13 P = import_fresh_module('decimal', blocked=['_decimal'])
16 # NOTE: This is the pi function from the decimal documentation, modified
35 D = C.Decimal
46 """decimal"""
47 D = P.Decimal
77 print("\nPrecision: %d decimal digits\n" % prec)
105 # C version of decimal
107 x = factorial(C.Decimal(n), 0)
/third_party/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/data/
Dnumberpermutationtest.txt1012 compact-short percent decimal-always
1026 compact-short currency/EUR decimal-always
1040 compact-short measure-unit/length-furlong decimal-always
1054 scientific/+ee/sign-always percent decimal-always
1068 scientific/+ee/sign-always currency/EUR decimal-always
1082 scientific/+ee/sign-always measure-unit/length-furlong decimal-always
1656 compact-short unit-width-narrow decimal-always
1670 compact-short unit-width-full-name decimal-always
1684 scientific/+ee/sign-always unit-width-narrow decimal-always
1698 scientific/+ee/sign-always unit-width-full-name decimal-always
[all …]
/third_party/icu/icu4c/source/test/testdata/
Dnumberpermutationtest.txt1012 compact-short percent decimal-always
1026 compact-short currency/EUR decimal-always
1040 compact-short measure-unit/length-furlong decimal-always
1054 scientific/+ee/sign-always percent decimal-always
1068 scientific/+ee/sign-always currency/EUR decimal-always
1082 scientific/+ee/sign-always measure-unit/length-furlong decimal-always
1656 compact-short unit-width-narrow decimal-always
1670 compact-short unit-width-full-name decimal-always
1684 scientific/+ee/sign-always unit-width-narrow decimal-always
1698 scientific/+ee/sign-always unit-width-full-name decimal-always
[all …]
/third_party/icu/ohos_icu4j/src/main/tests/resources/ohos/global/icu/dev/data/
Dnumberpermutationtest.txt1012 compact-short percent decimal-always
1026 compact-short currency/EUR decimal-always
1040 compact-short measure-unit/length-furlong decimal-always
1054 scientific/+ee/sign-always percent decimal-always
1068 scientific/+ee/sign-always currency/EUR decimal-always
1082 scientific/+ee/sign-always measure-unit/length-furlong decimal-always
1656 compact-short unit-width-narrow decimal-always
1670 compact-short unit-width-full-name decimal-always
1684 scientific/+ee/sign-always unit-width-narrow decimal-always
1698 scientific/+ee/sign-always unit-width-full-name decimal-always
[all …]
/third_party/python/Python/
Dpystrtod.c158 have to first fix the decimal separator.
216 /* Check that what's left begins with a digit or decimal point */ in _PyOS_ascii_strtod()
225 swapped for the current locale's decimal point before we in _PyOS_ascii_strtod()
227 locale's decimal point then the input is invalid. */ in _PyOS_ascii_strtod()
250 /* For the other cases, we need not convert the decimal in _PyOS_ascii_strtod()
257 locale-specific decimal point */ in _PyOS_ascii_strtod()
445 /* Given a string that may have a decimal point in the current
550 /* Remove trailing zeros after the decimal point from a numeric string; also
551 remove the decimal point if all digits following it are zero. The numeric
553 whitespace. Assumes that the decimal point is '.'. */
[all …]
/third_party/skia/third_party/externals/freetype/src/psaux/
Dpsconv.c37 /* digits (both decimal and non-decimal) into numbers. */
203 FT_Long decimal = 0; in PS_Conv_ToFixed() local
242 /* read the decimal part */ in PS_Conv_ToFixed()
261 if ( divider < 0xCCCCCCCL && decimal < 0xCCCCCCCL ) in PS_Conv_ToFixed()
263 decimal = decimal * 10 + c; in PS_Conv_ToFixed()
298 if ( !integral && !decimal ) in PS_Conv_ToFixed()
312 if ( decimal >= 0xCCCCCCCL ) in PS_Conv_ToFixed()
319 decimal *= 10; in PS_Conv_ToFixed()
330 decimal /= 10; in PS_Conv_ToFixed()
332 if ( !integral && !decimal ) in PS_Conv_ToFixed()
[all …]

12345678910>>...93