(12C) Decimal to Fraction
|
08-08-2018, 10:26 PM
Post: #21
|
|||
|
|||
RE: (12C) Decimal to Fraction
(08-08-2018 06:05 PM)Thomas Klemm Wrote: Hi, Thomas I noticed some issues with above Python code. dec2frac(2.0, 10) crashes with ZeroDivisionError. "if c < 2 and" should be "if c < 2 or" -> since it is translated from calculator code, you might want to check this. Although not a bug in Python, when code running in a calculator, v can be huge. -> v might be much bigger than c, corrected v below c might be off. Below is the patched code: Code: def dec2frac(f, c): |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)