Skip to content

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

Closed
@qsharoly

Description

@qsharoly

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"
  }
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions