Indices Function #26

Open
opened 2025-09-20 13:12:06 +01:00 by Vylpes · 2 comments
Owner
No description provided.
Vylpes added this to the 0.2.0 milestone 2025-09-20 13:12:06 +01:00
Member

Planning — needs/criteria

@Vylpes This issue has no description yet, so I cannot flesh out acceptance criteria without your input.

The title Indices Function suggests exponentiation (powers), alongside sibling stories Brackets Function (#25) and Variables Function (#27) in epic #21. Please confirm or correct that assumption, and answer the questions below so I can write solid criteria in the same format as #25.

Questions

  1. Scope — Does this story mean evaluating expressions with indices/exponents (e.g. 2^3 → 8)? If not, what should it cover?
  2. Syntax — Which input form(s) should be supported?
    • Caret: 2^3
    • Double asterisk: 2**3
    • Function call: pow(2, 3) / power(2, 3)
    • Something else?
  3. Exponent values — Which are in scope?
    • Positive integers only?
    • Zero and negative exponents (e.g. 2^-1 → 0.5)?
    • Non-integer exponents (e.g. 9^0.5 → 3)?
  4. Precedence — How should indices interact with +, -, *, /?
    • Standard maths (indices before multiplication, then left-to-right for same level)?
    • Continue left-to-right everywhere like #22 until BIDMAS (#32)?
  5. Dependencies — Must #22 (multiple operations) be complete first? Should bracketed exponents like 2^(1+2) depend on #25?
  6. Surfaces — CLI interactive, single-expression CLI (calculator cli "…"), and GUI — same as #25, or CLI-only for now?
  7. Errors — What should happen for invalid input such as 2^, ^3, 2^^3, or 0^0?

Once you reply, I will draft acceptance criteria, subtasks, and notes, then move this to needs/estimate.

## Planning — needs/criteria @Vylpes This issue has no description yet, so I cannot flesh out acceptance criteria without your input. The title **Indices Function** suggests exponentiation (powers), alongside sibling stories **Brackets Function** (#25) and **Variables Function** (#27) in epic #21. Please confirm or correct that assumption, and answer the questions below so I can write solid criteria in the same format as #25. ### Questions 1. **Scope** — Does this story mean evaluating expressions with indices/exponents (e.g. `2^3` → `8`)? If not, what should it cover? 2. **Syntax** — Which input form(s) should be supported? - Caret: `2^3` - Double asterisk: `2**3` - Function call: `pow(2, 3)` / `power(2, 3)` - Something else? 3. **Exponent values** — Which are in scope? - Positive integers only? - Zero and negative exponents (e.g. `2^-1` → `0.5`)? - Non-integer exponents (e.g. `9^0.5` → `3`)? 4. **Precedence** — How should indices interact with `+`, `-`, `*`, `/`? - Standard maths (indices before multiplication, then left-to-right for same level)? - Continue left-to-right everywhere like #22 until BIDMAS (#32)? 5. **Dependencies** — Must #22 (multiple operations) be complete first? Should bracketed exponents like `2^(1+2)` depend on #25? 6. **Surfaces** — CLI interactive, single-expression CLI (`calculator cli "…"`), and GUI — same as #25, or CLI-only for now? 7. **Errors** — What should happen for invalid input such as `2^`, `^3`, `2^^3`, or `0^0`? Once you reply, I will draft acceptance criteria, subtasks, and notes, then move this to **needs/estimate**.
Smithy-bot removed their assignment 2026-09-14 12:04:02 +01:00
Author
Owner

@Smithy-bot wrote in #26 (comment):

Planning — needs/criteria

@Vylpes This issue has no description yet, so I cannot flesh out acceptance criteria without your input.

The title Indices Function suggests exponentiation (powers), alongside sibling stories Brackets Function (#25) and Variables Function (#27) in epic #21. Please confirm or correct that assumption, and answer the questions below so I can write solid criteria in the same format as #25.

Questions

1. **Scope** — Does this story mean evaluating expressions with indices/exponents (e.g. `2^3` → `8`)? If not, what should it cover?

2. **Syntax** — Which input form(s) should be supported?
   
   * Caret: `2^3`
   * Double asterisk: `2**3`
   * Function call: `pow(2, 3)` / `power(2, 3)`
   * Something else?

3. **Exponent values** — Which are in scope?
   
   * Positive integers only?
   * Zero and negative exponents (e.g. `2^-1` → `0.5`)?
   * Non-integer exponents (e.g. `9^0.5` → `3`)?

4. **Precedence** — How should indices interact with `+`, `-`, `*`, `/`?
   
   * Standard maths (indices before multiplication, then left-to-right for same level)?
   * Continue left-to-right everywhere like #22 until BIDMAS (#32)?

5. **Dependencies** — Must #22 (multiple operations) be complete first? Should bracketed exponents like `2^(1+2)` depend on #25?

6. **Surfaces** — CLI interactive, single-expression CLI (`calculator cli "…"`), and GUI — same as #25, or CLI-only for now?

7. **Errors** — What should happen for invalid input such as `2^`, `^3`, `2^^3`, or `0^0`?

Once you reply, I will draft acceptance criteria, subtasks, and notes, then move this to needs/estimate.

@Smithy-bot

  1. That's correct
  2. Caret
  3. Any number
  4. Continue left-to-right, BIDMAS later on
  5. It should be able to be done at anytime, ideally 2^3 would resolve on its own
  6. CLI and GUI
  7. Should syntax error like other invalid expressions
@Smithy-bot wrote in https://git.vylpes.xyz/RabbitLabs/calculator/issues/26#issuecomment-21224: > ## [](#planning-needs-criteria)Planning — needs/criteria > > @Vylpes This issue has no description yet, so I cannot flesh out acceptance criteria without your input. > > The title **Indices Function** suggests exponentiation (powers), alongside sibling stories **Brackets Function** (#25) and **Variables Function** (#27) in epic #21. Please confirm or correct that assumption, and answer the questions below so I can write solid criteria in the same format as #25. > ### [](#questions)Questions > > 1. **Scope** — Does this story mean evaluating expressions with indices/exponents (e.g. `2^3` → `8`)? If not, what should it cover? > > 2. **Syntax** — Which input form(s) should be supported? > > * Caret: `2^3` > * Double asterisk: `2**3` > * Function call: `pow(2, 3)` / `power(2, 3)` > * Something else? > > 3. **Exponent values** — Which are in scope? > > * Positive integers only? > * Zero and negative exponents (e.g. `2^-1` → `0.5`)? > * Non-integer exponents (e.g. `9^0.5` → `3`)? > > 4. **Precedence** — How should indices interact with `+`, `-`, `*`, `/`? > > * Standard maths (indices before multiplication, then left-to-right for same level)? > * Continue left-to-right everywhere like #22 until BIDMAS (#32)? > > 5. **Dependencies** — Must #22 (multiple operations) be complete first? Should bracketed exponents like `2^(1+2)` depend on #25? > > 6. **Surfaces** — CLI interactive, single-expression CLI (`calculator cli "…"`), and GUI — same as #25, or CLI-only for now? > > 7. **Errors** — What should happen for invalid input such as `2^`, `^3`, `2^^3`, or `0^0`? > > > Once you reply, I will draft acceptance criteria, subtasks, and notes, then move this to **needs/estimate**. @Smithy-bot 1. That's correct 2. Caret 3. Any number 4. Continue left-to-right, BIDMAS later on 5. It should be able to be done at anytime, ideally 2^3 would resolve on its own 6. CLI and GUI 7. Should syntax error like other invalid expressions
Sign in to join this conversation.
No description provided.