Finding the Greatest Integer Square Root of an Integer

Click For Summary
SUMMARY

The discussion focuses on designing an algorithm to calculate the greatest integer square root of a positive integer input, denoted as 'i'. The algorithm should return the largest natural number less than or equal to the square root of 'i'. Examples provided include sqrt(1) = 1, sqrt(4) = 2, and sqrt(170) = 13. The participants seek clarification on implementing this in pseudo code, specifically for Pascal programming language.

PREREQUISITES
  • Understanding of integer mathematics and square root operations
  • Familiarity with algorithm design principles
  • Basic knowledge of Pascal programming language syntax
  • Experience with pseudo code representation
NEXT STEPS
  • Research how to implement integer square root algorithms in Pascal
  • Explore mathematical properties of square roots and their integer approximations
  • Learn about binary search techniques for efficient square root calculation
  • Study examples of pseudo code for mathematical algorithms
USEFUL FOR

Mathematicians, computer science students, and software developers interested in algorithm design and implementation in programming languages like Pascal.

teng125
Messages
416
Reaction score
0
Consider the square root operation. Suppose an integer numbers i > 0 as input variable.
Design an algorithm which calculates the greatest natural number less than or equal to
the square root of the input variable i.


can smby pls explain to me what does this ques mean??if possible explain using some example

thanx
 
Physics news on Phys.org
A natural number just means a positive integer, like 1, 2, 3, 4, 5.

Here are some examples of what your algorithm should do:
sqrt(1) = 1
sqrt(2) = 1
sqrt(3) = 1
sqrt(4) = 2
sqrt(5) = 2
sqrt(57) = 7
sqrt(170) = 13
 
what can i write for sqrt(i) in the pseudo code for pascal??

is it just sqrt(i) or any others??
 

Similar threads

  • · Replies 23 ·
Replies
23
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K