पायथन गणित। fmod () विधि
उदाहरण
x/y का शेषफल लौटाएं:
# Import math Library
import math
# Return the remainder of x/y
print(math.fmod(20,
4))
print(math.fmod(20, 3))
print(math.fmod(15, 6))
print(math.fmod(-10, 3))
print(math.fmod(0, 0))
परिभाषा और उपयोग
विधि x/y का math.fmod()
शेष (मॉड्यूलो) लौटाती है।
वाक्य - विन्यास
math.fmod(x, y)
पैरामीटर मान
Parameter | Description |
---|---|
x | Required. A positive or negative number to divide |
y | Required. A positive or negative number to divide x with |
नोट: यदि x और y = 0 दोनों हैं, तो यह एक ValueError देता है।
नोट: यदि y = 0 है, तो यह एक ValueError देता है।
नोट: यदि x या y कोई संख्या नहीं है, तो यह एक TypeError देता है।
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक float मान, शेष x/y . का प्रतिनिधित्व करता है |
---|---|
पायथन संस्करण: | 1.4 |