Skip to content

Add float.as_integer_ratio() #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Conversation

adrian17
Copy link
Contributor

@adrian17 adrian17 commented Mar 4, 2019

No description provided.

@codecov-io
Copy link

Codecov Report

Merging #600 into master will increase coverage by 0.12%.
The diff coverage is 47.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #600      +/-   ##
==========================================
+ Coverage   41.13%   41.25%   +0.12%     
==========================================
  Files          74       74              
  Lines       16880    16952      +72     
  Branches     4450     4487      +37     
==========================================
+ Hits         6944     6994      +50     
- Misses       7907     7932      +25     
+ Partials     2029     2026       -3
Impacted Files Coverage Δ
vm/src/obj/objfloat.rs 42.44% <47.61%> (+3.3%) ⬆️
vm/src/obj/objcomplex.rs 45% <0%> (-4.66%) ⬇️
parser/src/lexer.rs 55.72% <0%> (+0.37%) ⬆️
vm/src/pyobject.rs 59.47% <0%> (+0.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7c3f85...eed0b3c. Read the comment docs.

assert (-2.1).as_integer_ratio() == (-4728779608739021, 2251799813685248)
assert (-2100.0).as_integer_ratio() == (-2100, 1)
assert (2.220446049250313e-16).as_integer_ratio() == (1, 4503599627370496)
assert (1.7976931348623157e+308).as_integer_ratio() == (179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, some big number!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(that's sys.float_info.max)

@windelbouwman windelbouwman merged commit 458ead0 into RustPython:master Mar 5, 2019
@adrian17 adrian17 deleted the as_ratio branch March 5, 2019 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants