English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

If 2 = 1.414, and the square_root() function returns -1.414, does it violate the following specification? -- square_root (x) -- inputs: x is a real number , x ≥ 0 -- outputs: y is a real number - Computer Science

Advertisements
Advertisements

Question

If `sqrt2` = 1.414, and the square_root() function returns -1.414, does it violate the following specification?

-- square_root (x)
-- inputs: x is a real number , x ≥ 0
-- outputs: y is a real number such that y2 = x

One Line Answer

Solution

No, because (- 1.414)2 = 2, which satisfies input – output relation (y2 = x)

shaalaa.com
Algorithmic Problems
  Is there an error in this question or solution?
Chapter 6: Specification and Abstraction - Evaluation - Section - B [Page 86]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 6 Specification and Abstraction
Evaluation - Section - B | Q 5. | Page 86
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×