Python‎ > ‎Fraction‎ > ‎

Fraction.conjugate()

http://www.adilwaseem.com/

Definition
Return with the real numbers which could generate same fraction.

Syntax
Fraction(x).conjugate()

Parameters
Fraction

Examples
The return is:
from fractions import Fraction
a=Fraction(3.5).conjugate()
print("The value of a is:", a)

>>> 

7/2
>>>

The equal to:
 from fractions import Fraction
a=Fraction(9.3).conjugate()
print("The value of a is:", a)

>>> 
The value of a is: 2617717283409101/281474976710656
>>> 

Comments