/external/python/cpython2/Lib/test/ |
D | test_fractions.py | 31 return op(F.from_float(self.value), other) 250 self.assertRaises(TypeError, F.from_float, 3+4j) 251 self.assertEqual((10, 1), _components(F.from_float(10))) 253 self.assertEqual((bigint, 1), _components(F.from_float(bigint))) 254 self.assertEqual((0, 1), _components(F.from_float(-0.0))) 255 self.assertEqual((10, 1), _components(F.from_float(10.0))) 256 self.assertEqual((-5, 2), _components(F.from_float(-2.5))) 258 _components(F.from_float(1e23))) 259 self.assertEqual(float(10**23), float(F.from_float(1e23))) 261 _components(F.from_float(3.2))) [all …]
|
D | test_decimal.py | 1725 r = MyDecimal.from_float(0.1) 1730 self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) 1731 self.assertTrue(MyDecimal.from_float(float('nan')).is_qnan()) 1732 self.assertTrue(MyDecimal.from_float(float('inf')).is_infinite()) 1733 self.assertTrue(MyDecimal.from_float(float('-inf')).is_infinite()) 1734 self.assertEqual(str(MyDecimal.from_float(float('nan'))), 1736 self.assertEqual(str(MyDecimal.from_float(float('inf'))), 1738 self.assertEqual(str(MyDecimal.from_float(float('-inf'))), 1740 self.assertRaises(TypeError, MyDecimal.from_float, 'abc') 1743 self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip
|
/external/python/cpython3/Lib/test/ |
D | test_fractions.py | 27 return op(F.from_float(self.value), other) 249 self.assertRaises(TypeError, F.from_float, 3+4j) 250 self.assertEqual((10, 1), _components(F.from_float(10))) 252 self.assertEqual((bigint, 1), _components(F.from_float(bigint))) 253 self.assertEqual((0, 1), _components(F.from_float(-0.0))) 254 self.assertEqual((10, 1), _components(F.from_float(10.0))) 255 self.assertEqual((-5, 2), _components(F.from_float(-2.5))) 257 _components(F.from_float(1e23))) 258 self.assertEqual(float(10**23), float(F.from_float(1e23))) 260 _components(F.from_float(3.2))) [all …]
|
D | test_numeric_tower.py | 84 self.check_equal_hash(x, D.from_float(x)) 85 self.check_equal_hash(x, F.from_float(x))
|
D | test_decimal.py | 1188 a = A.from_float(42.5) 1191 a = A.from_float(42) 2549 r = MyDecimal.from_float(0.1) 2556 self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) 2557 self.assertTrue(MyDecimal.from_float(float('nan')).is_qnan()) 2558 self.assertTrue(MyDecimal.from_float(float('inf')).is_infinite()) 2559 self.assertTrue(MyDecimal.from_float(float('-inf')).is_infinite()) 2560 self.assertEqual(str(MyDecimal.from_float(float('nan'))), 2562 self.assertEqual(str(MyDecimal.from_float(float('inf'))), 2564 self.assertEqual(str(MyDecimal.from_float(float('-inf'))), [all …]
|
/external/python/cpython2/Lib/ |
D | fractions.py | 109 value = Fraction.from_float(numerator) 169 def from_float(cls, f): member in Fraction 540 return a == a.from_float(b) 568 return op(self, self.from_float(other))
|
D | decimal.py | 650 value = Decimal.from_float(value) 661 def from_float(cls, f): member in Decimal 697 from_float = classmethod(from_float) variable in Decimal 966 if Decimal.from_float(self_as_float) == self: 3953 d = Decimal.from_float(f) # An exact conversion 5868 return Decimal.from_float(other)
|
/external/python/cpython3/Lib/ |
D | fractions.py | 194 def from_float(cls, f): member in Fraction 582 return a == a.from_float(b) 606 return op(self, self.from_float(other))
|
D | _pydecimal.py | 659 value = Decimal.from_float(value) 669 def from_float(cls, f): member in Decimal 4121 d = Decimal.from_float(f) # An exact conversion 6024 return Decimal.from_float(other) 6063 return self, Decimal.from_float(other)
|
/external/fonttools/Lib/fontTools/misc/ |
D | py23.py | 369 d = _decimal.Decimal.from_float(number).quantize( 440 d = _decimal.Decimal.from_float(number).quantize(
|
/external/python/cpython2/Doc/library/ |
D | fractions.rst | 88 .. method:: from_float(flt) 92 ``Fraction.from_float(0.3)`` is not the same value as ``Fraction(3, 10)``.
|
D | decimal.rst | 542 .. method:: from_float(f) 546 Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. 557 >>> Decimal.from_float(0.1) 559 >>> Decimal.from_float(float('nan')) 561 >>> Decimal.from_float(float('inf')) 563 >>> Decimal.from_float(float('-inf')) 1115 as the context. Unlike the :meth:`Decimal.from_float` class method,
|
/external/python/cpython3/Doc/library/ |
D | fractions.rst | 97 .. method:: from_float(flt) 101 ``Fraction.from_float(0.3)`` is not the same value as ``Fraction(3, 10)``.
|
D | decimal.rst | 574 .. method:: from_float(f) 578 Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. 589 >>> Decimal.from_float(0.1) 591 >>> Decimal.from_float(float('nan')) 593 >>> Decimal.from_float(float('inf')) 595 >>> Decimal.from_float(float('-inf')) 1093 as the context. Unlike the :meth:`Decimal.from_float` class method, 1634 context flags. Explicit conversions with :meth:`~decimal.Decimal.from_float`
|
/external/python/cpython3/Doc/tutorial/ |
D | floatingpoint.rst | 290 >>> Fraction.from_float(0.1) 296 >>> Decimal.from_float(0.1) 299 >>> format(Decimal.from_float(0.1), '.17')
|
/external/python/cpython2/Misc/NEWS.d/ |
D | 2.6b2.rst | 234 Fractions from_float() and from_decimal() accept Integral arguments.
|
D | 2.7a1.rst | 4269 Added Decimal.from_float() and Context.create_decimal_from_float() to the 4319 Fractions.from_float() no longer loses precision for integers too big to
|
/external/skia/src/opts/ |
D | SkRasterPipeline_opts.h | 2473 SI U16 from_float(float f) { return f * 255.0f + 0.5f; } 2623 r = from_float(rgb[0]); 2624 g = from_float(rgb[1]); 2625 b = from_float(rgb[2]); 3066 U16 c = from_float(*f); 3073 U16 c = from_float(*f);
|
/external/skqp/src/opts/ |
D | SkRasterPipeline_opts.h | 2457 SI U16 from_float(float f) { return f * 255.0f + 0.5f; } 2607 r = from_float(rgb[0]); 2608 g = from_float(rgb[1]); 2609 b = from_float(rgb[2]); 3048 U16 c = from_float(*f); 3055 U16 c = from_float(*f);
|
/external/eigen/Eigen/src/Core/arch/CUDA/ |
D | PacketMathHalf.h | 494 Packet16f from_float = half2float(from); 495 return half(predux(from_float));
|
/external/python/cpython3/Doc/whatsnew/ |
D | 3.1.rst | 253 >>> Decimal.from_float(1.1)
|
D | 3.2.rst | 1313 directly so there in no longer a need to use the :meth:`~decimal.Decimal.from_float` 1321 :meth:`~fractions.Fraction.from_float()` and :meth:`~fractions.Fraction.from_decimal`
|
D | 2.7.rst | 1184 :meth:`~decimal.Decimal.from_float` class method that performs an exact 1190 For example, ``Decimal.from_float(0.1)`` returns
|
/external/python/cpython2/Doc/whatsnew/ |
D | 2.7.rst | 1169 :meth:`~decimal.Decimal.from_float` class method that performs an exact 1175 For example, ``Decimal.from_float(0.1)`` returns
|
/external/python/cpython3/Misc/NEWS.d/ |
D | 3.7.0a1.rst | 3461 Fixed different behaviour of Decimal.from_float() for _decimal and
|