forked from bat67/The-Python-Standard-Library-by-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsys_float_info.py
More file actions
26 lines (25 loc) · 832 Bytes
/
Copy pathsys_float_info.py
File metadata and controls
26 lines (25 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
# encoding: utf-8
#end_pymotw_header
import sys
print('Smallest difference (epsilon):', sys.float_info.epsilon)
print()
print('Digits (dig) :', sys.float_info.dig)
print('Mantissa digits (mant_dig):', sys.float_info.mant_dig)
print()
print('Maximum (max):', sys.float_info.max)
print('Minimum (min):', sys.float_info.min)
print()
print('Radix of exponents (radix):', sys.float_info.radix)
print()
print('Maximum exponent for radix (max_exp):',
sys.float_info.max_exp)
print('Minimum exponent for radix (min_exp):',
sys.float_info.min_exp)
print()
print('Max. exponent power of 10 (max_10_exp):',
sys.float_info.max_10_exp)
print('Min. exponent power of 10 (min_10_exp):',
sys.float_info.min_10_exp)
print()
print('Rounding for addition (rounds):', sys.float_info.rounds)