Python Practice › sys Module Programs › Program 15
Float limits
Write a Python program that prints the largest float and float precision.
Output
1.7976931348623157e+308 15 decimal digits of precision
Approach
sys.float_info.
Solution
import sys print(sys.float_info.max)print(sys.float_info.dig, "decimal digits of precision")Output
1.7976931348623157e+308 15 decimal digits of precision
Learn the concept
New to this topic? Read the lesson, then come back.