Square root #6
Labels
No labels
aira:blocked
aira:cancelled
aira:ci
aira:done
aira:implementing
aira:merging
aira:plan-review
aira:planning
aira:qa
aira:queued
aira:ready
aira:review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/web-calculator-2#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a square root operation. It is the first unary operation, so the API must accept it without
b.Requirements
GET /api/calculate?a=<number>&op=sqrtreturns{"result": Math.sqrt(a)}.bis not required forsqrtand is ignored if present.400 {"error": "square root of a negative number"}.aandb.√button that applies to the number currently on the display immediately (no=needed). Pressing8,1,√shows9; a negative input showsError.Acceptance criteria
/api/calculate?a=81&op=sqrtreturns{"result":9}./api/calculate?a=2&op=sqrtreturns a result between 1.41421 and 1.41422./api/calculate?a=-4&op=sqrtreturns 400{"error":"square root of a negative number"}./api/calculate?a=1&op=add(missing b) still returns 400.√button.Aira · queued
Aira picked up this task. Branch
aira/6-square-root.