Description:
Exact math beyond operators - verified on Python 3.10.12:
- math.isqrt(10)=3 exact int root; math.gcd(12,18)=6; math.lcm(4,6)=12
- math.factorial(5)=120; math.prod([2,3,4])=24
- math.ceil(2.1)=3, floor(2.9)=2; trunc(-2.9)=-2 toward zero, floor(-2.9)=-3
- math.fsum([0.1]*10)=1.0 exactly (sum gives 0.9999999999999999)
- pi/tau/e constants; nan never equals itself (use math.isnan); inf beats any finite
- math.dist((0,0),(3,4))=5.0 = math.hypot(3,4)
#Shorts #Python #CodeGurukul #math #Programming
Share this link via
Or copy link
























