Skip to content

Commit 0e138d7

Browse files
xanniIsaacGkotptasxatzial
authored
Update square-root description.md (#2495)
* Update description.md Moving generally applicable information from the Python specific addendum as per https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678/1 and https://forum.exercism.org/t/square-root-exercise-instructions-could-be-clearer/13664/11 See also https://github.com/exercism/python/pull/3815/files * Update description.md Include text suggested by tasx in the discussion at https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678/7 * Update description.md Incorporate changes workshopped in the discussion at https://forum.exercism.org/t/moving-generic-instructions-from-python-addendum-to-overall-problem-specification/13678 * Update description.md Comply with markdown style guide for bullet lists * One line per sentence and don't use the word "function" * Split description into introduction and instructions * Update exercises/square-root/introduction.md Co-authored-by: Isaac Good <[email protected]> * Update exercises/square-root/instructions.md Co-authored-by: Isaac Good <[email protected]> * Update exercises/square-root/instructions.md Co-authored-by: Isaac Good <[email protected]> * Terminate sentences with periods. * Rephrase introduction. * Update exercises/square-root/instructions.md Co-authored-by: Victor Goff <[email protected]> * Update exercises/square-root/introduction.md Co-authored-by: Victor Goff <[email protected]> * Further wording changes * Simplify introduction * Replace "output" with "return" * Remove Wikipedia links * Revert "Remove Wikipedia links" This reverts commit b18c2a2. * Update exercises/square-root/instructions.md Co-authored-by: Anastasios Chatzialexiou <[email protected]> * Update exercises/square-root/introduction.md Co-authored-by: Anastasios Chatzialexiou <[email protected]> * Clarify requirements * Remove "directly" --------- Co-authored-by: Isaac Good <[email protected]> Co-authored-by: Victor Goff <[email protected]> Co-authored-by: Anastasios Chatzialexiou <[email protected]>
1 parent 0bc4985 commit 0e138d7

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

exercises/square-root/description.md

-13
This file was deleted.

exercises/square-root/instructions.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Instructions
2+
3+
Your task is to calculate the square root of a given number.
4+
5+
- Try to avoid using the pre-existing math libraries of your language.
6+
- As input you'll be given a positive whole number, i.e. 1, 2, 3, 4…
7+
- You are only required to handle cases where the result is a positive whole number.
8+
9+
Some potential approaches:
10+
11+
- Linear or binary search for a number that gives the input number when squared.
12+
- Successive approximation using Newton's or Heron's method.
13+
- Calculating one digit at a time or one bit at a time.
14+
15+
You can check out the Wikipedia pages on [integer square root][integer-square-root] and [methods of computing square roots][computing-square-roots] to help with choosing a method of calculation.
16+
17+
[integer-square-root]: https://en.wikipedia.org/wiki/Integer_square_root
18+
[computing-square-roots]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots

exercises/square-root/introduction.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Introduction
2+
3+
We are launching a deep space exploration rocket and we need a way to make sure the navigation system stays on target.
4+
5+
As the first step in our calculation, we take a target number and find its square root (that is, the number that when multiplied by itself equals the target number).
6+
7+
The journey will be very long.
8+
To make the batteries last as long as possible, we had to make our rocket's onboard computer very power efficient.
9+
Unfortunately that means that we can't rely on fancy math libraries and functions, as they use more power.
10+
Instead we want to implement our own square root calculation.

0 commit comments

Comments
 (0)