Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between abs () and fabs ()?



What is the difference between abs () and fabs ()?..

Answer / Ganesh Soni

Both `abs()` and `fabs()` return the absolute value of a number, but they differ in their arguments. `abs()` can be used with numbers as well as complex numbers (`complex(a, b).abs()`), while `fabs()` is used specifically for floating point numbers (`float` or `numpy.float64`) and returns the absolute value ignoring the sign, similar to `abs()`, but without the overhead of checking if the number is a complex one.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are the built-in types available in python?

1 Answers  


How is python interpreted?

1 Answers  


Which language should I learn first c or python?

1 Answers  


What is a flask?

1 Answers  


What is __ init__ in python?

1 Answers  


Why does python use self?

1 Answers  


How are data types defined in python?

1 Answers  


What is setup py?

1 Answers  


When to use list vs. tuple vs. dictionary vs. set?

1 Answers  


What does the <self> keyword do?

1 Answers  


Is cython as fast as c?

1 Answers  


Which methods of python are used to determine the type of instance and inheritance?

1 Answers  


Categories