37.4k views
14 votes
The fractional_part function divides the numerator by the denominator, and returns just the fractional part.

a. True
b. False

User Deneil
by
3.6k points

1 Answer

2 votes

Answer:

a. True

Step-by-step explanation:

The fractional_part function divides the numerator by the denominator, and in turn returns just the fractional part, which is usually a number between 0 and 1.

When the denominator is 0, it produces an error result, instead of attempting the division, the function can be programmed to return "Math Error: cannot be divided by zero", as shown in the following Python code;

def fractional_part(numerator, denominator):

if denominator == 0:

return "Math Error: cannot be divided by zero"

return (numerator % denominator)/denominator

User Dinosaurwaltz
by
3.4k points