Home
last modified time | relevance | path

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

12345678910>>...112

/third_party/decimal.js/
Ddecimal.d.ts1 // Type definitions for decimal.js >=7.0.0
2 // Project: https://github.com/MikeMcl/decimal.js
4 // Definitions: https://github.com/MikeMcl/decimal.js
6 // Documentation: http://mikemcl.github.io/decimal.js/
10 // class Decimal (default export)
11 // type Decimal.Constructor
12 // type Decimal.Instance
13 // type Decimal.Modulo
14 // type Decimal.Rounding
15 // type Decimal.Value
[all …]
Ddecimal.global.d.ts1 // Type definitions for decimal.js >=7.0.0
2 // Project: https://github.com/MikeMcl/decimal.js
4 // Definitions: https://github.com/MikeMcl/decimal.js
6 // Documentation: http://mikemcl.github.io/decimal.js/
10 // class Decimal (default export)
11 // type Decimal.Constructor
12 // type Decimal.Instance
13 // type Decimal.Modulo
14 // type Decimal.Rounding
15 // type Decimal.Value
[all …]
DREADME.md1 ![decimal.js](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/decimaljs.png)
3 An arbitrary-precision Decimal type for JavaScript.
5 [![npm version](https://img.shields.io/npm/v/decimal.js.svg)](https://www.npmjs.com/package/decimal
6 [![npm downloads](https://img.shields.io/npm/dw/decimal.js)](https://www.npmjs.com/package/decimal.…
7 [![Build Status](https://travis-ci.org/MikeMcl/decimal.js.svg)](https://travis-ci.org/MikeMcl/decim…
8 [![CDNJS](https://img.shields.io/cdnjs/v/decimal.js.svg)](https://cdnjs.com/libraries/decimal.js)
21 - Comprehensive [documentation](https://mikemcl.github.io/decimal.js/) and test set
23 - Includes a TypeScript declaration file: *decimal.d.ts*
25 ![API](https://raw.githubusercontent.com/MikeMcl/decimal.js/gh-pages/API.png)
28 precision is specified in terms of significant digits rather than decimal places, and all
[all …]
Dpackage.json2 "name": "decimal.js",
3 "description": "An arbitrary-precision Decimal type for JavaScript.",
11 "decimal",
21 "url": "https://github.com/MikeMcl/decimal.js.git"
23 "main": "decimal",
24 "module": "decimal.mjs",
25 "browser": "decimal.js",
28 "types": "./decimal.d.ts",
29 "import": "./decimal.mjs",
30 "require": "./decimal.js"
[all …]
DREADME_zh.md1 # decimal.js
3 API官方文档:[https://mikemcl.github.io/decimal.js/](https://mikemcl.github.io/decimal.js/)
6 decimal.js是JavaScript的一个高精度数学库,它具有以下特性
31 decimal.mjs #decimal源码
38 decimal.js被引入在OpenHarmony的third_party目录下,通过OpenHarmony中部件依赖的方式进行编译。
51 deps = [ "//third_party/decimal.js:decimal" ]
66 编译生成的文件对应路径:`out/rk3568/thirdparty/decimal.js/libdecimal.z.so`。
73 import { Decimal } from '@kit.ArkTS';
84 let a0 : Decimal = new Decimal(1.2345678912345678) // 可以使用Decimal表示数值
85 console.log("test Decimal :" + a0.toString()); // 可以通过toString获取Decimal表示的数值
[all …]
DCHANGELOG.md11 * #205 Add './decimal' subpath to *package.json* `exports`.
26 * #101 Add `Decimal.clamp` method.
27 * #161 Fix Decimal instances deemed plain objects.
28 * #100 Add `Decimal.sum` method.
34 * Add minified versions for both *decimal.js* and *decimal.mjs*.
55 * #121 Constructor: add range check for arguments of type number and Decimal.
57 * Move *decimal.min.js.map* to root directory.
61 * #114 Remove soureMappingURL from *decimal.min.js*.
85 * Correct typings: `toFraction` returns `Decimal[]`.
86 * Type-checking: add `Decimal.isDecimal` method.
[all …]
Ddecimal.js6 * decimal.js v10.5.0
7 * An arbitrary-precision Decimal type for JavaScript.
8 * https://github.com/MikeMcl/decimal.js
35 // The initial configuration properties of the Decimal constructor.
39 // Most of these values can be changed at run-time using the `Decimal.config` method.
42 // E.g. `Decimal.config({ precision: 20 });`
58 // `Decimal.rounding = 4;`
59 // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
101 Decimal, inexact, noConflict, quadrant,
108 tag = '[object Decimal]',
[all …]
/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
53 C = import_fresh_module('decimal', fresh=['_decimal'])
54 P = import_fresh_module('decimal', blocked=['_decimal'])
55 import decimal as orig_sys_decimal
57 # fractions module must import the correct decimal module.
59 sys.modules['decimal'] = P
61 sys.modules['decimal'] = C
63 sys.modules['decimal'] = orig_sys_decimal
[all …]
/third_party/decimal.js/test/modules/
Dconfig.js27 t(Decimal.config({}) === Decimal);
29 tx(function () {Decimal.config()}, "config()");
30 tx(function () {Decimal.config(null)}, "config(null)");
31 tx(function () {Decimal.config(undefined)}, "config(undefined)");
32 tx(function () {Decimal.config(0)}, "config(0)");
33 tx(function () {Decimal.config('')}, "config('')");
34 tx(function () {Decimal.config('hi')}, "config('hi')");
35 tx(function () {Decimal.config('123')}, "config('123')");
37 Decimal.config({
48 t(Decimal.precision === 20);
[all …]
DisFiniteEtc.js9 Decimal.config({
18 var n = new Decimal(1);
33 t(n.equals(new Decimal(1)));
43 n = new Decimal('-0.1');
57 n = new Decimal(Infinity);
72 n = new Decimal('-Infinity');
87 n = new Decimal('0.0000000');
101 n = new Decimal(-0);
117 n = new Decimal('NaN');
133 n = new Decimal('-1.234e+2');
[all …]
Dsum.js7 T.assertEqualDecimal(expected, Decimal.sum.apply(Decimal, arguments));
10 expected = new Decimal(0);
13 t('0', new Decimal(0));
15 t(0, new Decimal('-10'), 0, 0, 0, 0, 0, 10);
17 t(1, '2', new Decimal(3), new Decimal('4'), -10);
18 t(new Decimal(-10), '9', new Decimal(0.01), 0.99);
20 expected = new Decimal(10);
23 t('0', new Decimal('10'));
27 t(1, '2', new Decimal(3), new Decimal('4'));
28 t('9', new Decimal(0.01), 0.99);
[all …]
DDecimal.js3 T('Decimal', function () {
5 Decimal.config({
17 T.assertEqualProps(coefficient, exponent, sign, new Decimal(n));
100 T.assertEqual(expected, new Decimal(n).valueOf());
167 tx(function () {new Decimal(' NaN')}, "' NaN'");
168 tx(function () {new Decimal('NaN ')}, "'NaN '");
169 tx(function () {new Decimal(' NaN ')}, "' NaN '");
170 tx(function () {new Decimal(' -NaN')}, "' -NaN'");
171 tx(function () {new Decimal(' +NaN')}, "' +NaN'");
172 tx(function () {new Decimal('-NaN ')}, "'-NaN '");
[all …]
Dclone.js9 Decimal.config({
18 var D1 = Decimal.clone({ precision: 1 });
19 var D2 = Decimal.clone({ precision: 2 });
20 var D3 = Decimal.clone({ precision: 3 });
21 var D4 = Decimal.clone({ precision: 4 });
22 var D5 = Decimal.clone({ precision: 5 });
23 var D6 = Decimal.clone({ precision: 6 });
24 var D7 = Decimal.clone({ precision: 7 });
25 var D8 = Decimal.clone();
27 var D9 = Decimal.clone({ precision: 9 });
[all …]
Dimmutability.js2 // Also tests each Decimal.prototype method against its equivalent Decimal method where applicable.
7 Decimal.config({
34 (x = Decimal.random()),
38 (x = Decimal.random().plus(randInt())),
43 a = new Decimal(v[i]);
44 aa = new Decimal(v[i]);
46 b = k == 0.5 ? new Decimal(a) : a[k < 0.5 ? 'plus' : 'minus'](Decimal.random().plus(randInt()));
47 bb = new Decimal(b);
54 z = Decimal.abs(a);
62 y = Decimal.ceil(a);
[all …]
DtoNearest.js9 Decimal.config({
22 t(!isMinusZero(new Decimal(0).toNearest(0)));
23 t( isMinusZero(new Decimal(-1).toNearest(0)));
24 t( isMinusZero(new Decimal(-0).toNearest(0)));
25 t(!isMinusZero(new Decimal(1).toNearest(0)));
26 t(!isMinusZero(new Decimal(1).toNearest(-0)));
27 t(!isMinusZero(new Decimal(1).toNearest(-3)));
28 t( isMinusZero(new Decimal(-1).toNearest(-3)));
31 T.assertEqual(expected, new Decimal(n).toNearest(v, rm).valueOf());
94 Decimal.precision = 3;
[all …]
DtoFixed.js6 T.assertEqual(expected, new Decimal(n).toFixed(dp));
13 Decimal.config({
110 Decimal.rounding = 0;
154 Decimal.rounding = 1;
195 Decimal.rounding = 2;
238 Decimal.rounding = 3;
281 Decimal.rounding = 4;
282 Decimal.toExpNeg = Decimal.toExpPos = 0;
324 Decimal.rounding = 5;
362 Decimal.rounding = 6;
[all …]
DdpSd.js6 T.assertEqual(dp, new Decimal(n).dp());
7 T.assertEqual(dp, new Decimal(n).decimalPlaces());
8 T.assertEqual(sd, new Decimal(n).sd(zs));
9 T.assertEqual(sd, new Decimal(n).precision(zs));
16 Decimal.config({
65 tx(function () {new Decimal(1).precision(null)}, "new Decimal(1).precision(null)");
66 tx(function () {new Decimal(1).sd(null)}, "new Decimal(1).sd(null)");
67 tx(function () {new Decimal(1).sd(2)}, "new Decimal(1).sd(2)");
68 tx(function () {new Decimal(1).sd('3')}, "new Decimal(1).sd('3')");
69 tx(function () {new Decimal(1).sd({})}, "new Decimal(1).sd({})");
/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 …]
/third_party/decimal.js/doc/
DAPI.html7 <title>decimal.js API</title>
64 <ul><li><a href="#decimal"><strong>Decimal</strong></a></li></ul>
216 <h1>decimal<span id='js'>.js</span></h1>
218 <p>An arbitrary-precision Decimal type for JavaScript.</p>
219 <p><a href='https://github.com/MikeMcl/decimal.js'>Hosted on GitHub</a>.</p>
224 See the <a href='https://github.com/MikeMcl/decimal.js'>README</a> on GitHub for a quick-start
233 <a href='#decimal'><code>Decimal</code></a>, the constructor of Decimal instances.
237 If necessary, multiple Decimal constructors can be created, each with their own independent
238 configuration, e.g. precision and range, which applies to all Decimal instances created from
244 A new Decimal constructor is created by calling the <code><a href='#Dclone'>clone</a></code>
[all …]
/third_party/skia/m133/third_party/externals/icu/source/data/locales/
Doc_ES.txt20 decimal{"."}
52 decimal{"."}
67 decimal{"."}
82 decimal{"."}
97 decimal{"."}
112 decimal{"."}
127 decimal{"."}
142 decimal{"."}
157 decimal{"."}
172 decimal{"."}
[all …]
/third_party/skia/m133/third_party/externals/icu/source/data/misc/
Dplurals.txt337 " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1."
342 one{"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"}
344 " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2."
351 "11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1"
355 " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0"
364 "00, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1"
369 " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0."
377 "101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 1"
381 " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, "
392 one{"i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6"}
[all …]
/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/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/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 …]

12345678910>>...112