Skip to content
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

Resistor Color Trio: add test case >1000 but not divisible by 1000 #1989

Closed
qsharoly opened this issue Mar 22, 2022 · 2 comments · May be fixed by #1652
Closed

Resistor Color Trio: add test case >1000 but not divisible by 1000 #1989

qsharoly opened this issue Mar 22, 2022 · 2 comments · May be fixed by #1652

Comments

@qsharoly
Copy link

Currently some solutions check if resistance value is >= 1000 and use integer division to switch to kilo-ohms, which causes loss of precision for values that are larger than 1000, but are not divisible by 1000.

This testcase will ensure divisibility by 1000 before transitioning to kilo-ohms.

{
  "description": "Red and red and red",
  "property": "label",
  "input": {
    "colors": ["red", "red", "red"]
  },
  "expected": {
    "value": 2200,
    "unit": "ohms"
  }
},
@SaschaMann
Copy link
Contributor

This is effectively a duplicate of #1651 / #1652

@qsharoly
Copy link
Author

Oops

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 a pull request may close this issue.

2 participants