Python functions-ABS ()

Source: Internet
Author: User
From today onwards, I will update a Python function every day, with the example and the point of attention when using the function. I gave this function a special name called "Python function daily", I hope you support. Oh


Now, the function of today is ABS ()


Read the official English document explanation first


ABS (x)

Return the absolute value of a number. The argument is a plain or long integer or a floating point number. If The argument is a complex number, it magnitude is returned.


Detailed

Return absolute Value


Parameters can be: negative, positive, floating-point, or long-shaped


Instance:

ABS ( -1.2) #返回 1.2  ABS (1.2) #返回 1.2  ABS ( -11216.5) #返回 11216.5  abs (11216.5) #返回 11216.5


Note: The parameter can be a negative number or a positive number. Only the absolute value is taken, and the rounding is not done.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.