Float limits

Easysys Module Programs · 15 of 20

Write a Python program that prints the largest float and float precision.

Advertisement
Output
1.7976931348623157e+308
15 decimal digits of precision

Approach

  1. sys.float_info.

Solution

Python
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.

More sys module programs

← All 20 sys Module Programs

Leave a Comment