Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 510 Bytes

File metadata and controls

7 lines (5 loc) · 510 Bytes

Write a function extract_decimal(f: float) -> float that takes a floating-point number f as input and returns only the decimal part of f as a floating-point number.

For example:

  • extract_decimal(12.345) → 0.345

Depending on how you solve this, you may have to deal with quirks in floating point operations in Python. To learn more about this quirk and workarounds, see this blog post.