पायथन math.isqrt () विधि
उदाहरण
एक वर्गमूल संख्या को नीचे की ओर निकटतम पूर्णांक में गोल करें:
# Import math Library
import math
# Print the square
root of different numbers
print (math.sqrt(10))
print (math.sqrt (12))
print (math.sqrt (68))
print (math.sqrt (100))
# Round square root
downward to the nearest integer
print (math.isqrt(10))
print
(math.isqrt (12))
print (math.isqrt (68))
print (math.isqrt (100))
परिभाषा और उपयोग
यह math.isqrt()
विधि एक वर्गमूल संख्या को नीचे की ओर निकटतम पूर्णांक तक गोल करती है।
नोट: संख्या 0 से अधिक या उसके बराबर होनी चाहिए।
वाक्य - विन्यास
math.isqrt(x)
पैरामीटर मान
Parameter | Description |
---|---|
x | Required. The number to round the square root of. If x is negative, it returns a ValueError. If x is not a number, it returns a TypeError |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | दशमलव के बिना किसी int संख्या के वर्गमूल का प्रतिनिधित्व करने वाला मान |
---|---|
पायथन संस्करण: | 3.8 |