- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# How to find the fractional and integer parts of x in a two-item tuple in Python?

The method modf() returns the fractional and integer parts of x in a two-item tuple. Both parts have the same sign as x. The integer part is returned as a float. First item in tuple is fractional part

>>> import math >>> math.modf(100.73) (0.730000000000004, 100.0) >>> math.modf(-5.55) (-0.5499999999999998, -5.0)

- Related Questions & Answers
- Return the fractional and integral parts of a value in Numpy
- Return the fractional and integral parts of array values in Numpy
- Extract the fractional and integral parts of a specific array value in Numpy
- Convert Tuple to integer in Python
- How to randomly select an item from a tuple in Python?
- How to find the fractional power of a negative number in R?
- How do I find the largest integer less than x in Python?
- Python program to Find the size of a Tuple
- Python to Find number of lists in a tuple
- How to remove two parts of a string with JavaScript?
- Evaluate a Hermite series at tuple of points x in Python
- Evaluate a Laguerre series at tuple of points x in Python
- Evaluate a Hermite_e series at tuple of points x in Python
- Evaluate a Legendre series at tuple of points x in Python
- Program to find smallest difference of angles of two parts of a given circle in C++

Advertisements