Home
last modified time | relevance | path

Searched refs:Fraction (Results 1 - 19 of 19) sorted by relevance

/third_party/python/Lib/
H A Dfractions.py4 """Fraction, infinite-precision, rational numbers."""
13 __all__ = ['Fraction']
38 class Fraction(numbers.Rational): class
41 In the two-argument form of the constructor, Fraction(8, 6) will
44 defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.
71 >>> Fraction(10, -8)
72 Fraction(-5, 4)
73 >>> Fraction(Fraction(
[all...]
H A Dstatistics.py135 from fractions import Fraction namespace
164 (<class 'float'>, Fraction(19, 2), 5)
170 (<class 'float'>, Fraction(1000, 1), 3000)
174 >>> from fractions import Fraction as F
176 (<class 'fractions.Fraction'>, Fraction(63, 20), 4)
181 (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)
203 total = sum(Fraction(n, d) for d, n in partials.items())
232 ssd = c = Fraction(0)
239 sx = sum(Fraction(
[all...]
/third_party/python/Lib/test/
H A Dtest_statistics.py22 from fractions import Fraction namespace
320 args1 = [2456, 37.8, -12.45, Decimal('2.54'), Fraction(17, 54)]
321 args2 = [2459, 37.2, -12.41, Decimal('2.59'), Fraction(15, 54)]
343 for type_ in (int, float, Decimal, Fraction):
392 # Test that equal Fraction values are exactly equal.
393 F = Fraction
411 f = Fraction(n, 1234)
421 for x in [8347, 101.3, -7910.28, Fraction(5, 21)]:
427 for x in [41017, 16.742, -813.02, Fraction(3, 8)]:
454 F = Fraction
[all...]
H A Dtest_random.py13 from fractions import Fraction namespace
279 [Fraction(1, 3), Fraction(2, 6), Fraction(3, 6), Fraction(4, 6)], # fractional weights
295 [Fraction(1, 3), Fraction(2, 6), Fraction(3, 6), Fraction(4, 6)], # fractional cum_weights
511 self.assertWarns(DeprecationWarning, self.gen.randrange, Fraction(
[all...]
H A Dtest_math.py760 from fractions import Fraction namespace
777 self.assertEqual(hypot(Fraction(12, 32), Fraction(5, 32)), Fraction(13, 32))
898 from fractions import Fraction as F
1382 from fractions import Fraction namespace
1389 fx, fy, fr = Fraction(x), Fraction(y), Fraction(r)
2239 # test with Fraction value
2240 from fractions import Fraction global() namespace
[all...]
H A Dtest_compare.py4 from fractions import Fraction namespace
421 q1 = Fraction(2002, 2)
422 q2 = Fraction(2003, 2)
H A Dtest_itertools.py8 from fractions import Fraction namespace
132 for typ in int, complex, Decimal, Fraction: # multiple types
545 self.assertEqual(take(3, count(Fraction(2, 3))),
546 [Fraction(2, 3), Fraction(5, 3), Fraction(8, 3)])
595 self.assertEqual(take(3, count(Fraction(2,3), Fraction(1,7))),
596 [Fraction(2,3), Fraction(1
[all...]
H A Dtest_fractions.py16 F = fractions.Fraction
52 """Test comparison of Fraction with a naive rational implementation."""
60 if isinstance(other, fractions.Fraction):
83 class DummyFraction(fractions.Fraction):
84 """Dummy Fraction subclass for copy and deepcopy testing."""
129 self.assertRaisesMessage(ZeroDivisionError, "Fraction(12, 0)",
185 ZeroDivisionError, "Fraction(3, 0)",
188 ValueError, "Invalid literal for Fraction: '3/'",
191 ValueError, "Invalid literal for Fraction: '/2'",
194 ValueError, "Invalid literal for Fraction
[all...]
H A Dtest_numeric_tower.py1 # test interactions between int, float, Decimal and Fraction
10 from fractions import Fraction as F
177 # int, float, Fraction, Decimal
H A Dtest_float.py303 R = fractions.Fraction
H A Dtest_builtin.py1587 fractions.Fraction(123456, 100)]:
H A Dtest_buffer.py25 from fractions import Fraction namespace
2530 2.2+3j, Decimal("-21.1"), 12.2, Fraction(5, 2),
H A Dtest_os.py1704 for value in (-1.0, -1j, decimal.Decimal(-1), fractions.Fraction(-2, 2)):
H A Dtest_decimal.py1788 F = fractions[self.decimal].Fraction
/third_party/rust/crates/minimal-lexical/etc/correctness/test-parse-random/
H A Druntests.py95 from fractions import Fraction namespace
241 POW2 = { e: Fraction(2) ** e for e in range(-1100, 1100) }
242 HALF_ULP = { e: (Fraction(2) ** e)/2 for e in range(-1100, 1100) }
341 MIN_SUBNORMAL_DOUBLE = Fraction(2) ** -1074
342 MIN_SUBNORMAL_SINGLE = Fraction(2) ** -149 # XXX unsure
343 MAX_DOUBLE = (2 - Fraction(2) ** -52) * (2 ** 1023)
344 MAX_SINGLE = (2 - Fraction(2) ** -23) * (2 ** 127)
359 real = Fraction(text)
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/Utils/
H A DImportedFunctionsInliningStatistics.cpp70 static std::string getStatString(const char *Msg, int32_t Fraction, int32_t All, in getStatString() argument
75 Result = 100 * static_cast<double>(Fraction) / All; in getStatString()
78 Str << std::setprecision(4) << Msg << ": " << Fraction << " [" << Result in getStatString()
/third_party/rust/crates/minimal-lexical/etc/
H A Dlemire_table.py19 from fractions import Fraction namespace
/third_party/python/Modules/_decimal/tests/
H A Dranddec.py50 from fractions import Fraction namespace
467 return Fraction(num, denom)
/third_party/node/deps/v8/src/temporal/
H A Dtemporal-parser.cc185 // Fraction: DecimalSeparator FractionalPart
526 // Sign Hour : MinuteSecond : MinuteSecond [Fraction]
527 // Sign Hour MinuteSecond MinuteSecond [Fraction]
568 // Sign Hour MinuteSecond MinuteSecond [Fraction] in ScanTimeZoneUTCOffsetName()
979 SCAN_FORWARD(TimeFraction, Fraction, int64_t)
1027 int32_t len = ScanDuration##Name##Fraction(str, cur, &fraction); \

Completed in 52 milliseconds