03:00

X Sonining Absolyut Qiymati

Salbiy bo'lsa ham — har doim musbat natija!

Absolyut qiymat formulasi
|x| = x (agar x ≥ 0) yoki -x (agar x < 0)
Python'da: math.fabs(x) yoki abs(x)
0
|?| = ?
import math
x = float(input('x='))
y = ____?____
print('fabs(', x, ')=', y)
  
math.fabs(x)
abs(x)
-x
math.sqrt(x*x)
x if x >= 0 else -x
math.trunc(x)
x * x