Python‎ > ‎Fraction‎ > ‎

Fraction.real()

http://www.adilwaseem.com/

Definition
The method will return with the real value.

Syntax
Fraction.real()

Parameters
Number

Examples
 >>> Fraction(2.11).real
Fraction(4751297606875873, 2251799813685248)
>>> Fraction(2,1).real
Fraction(2, 1)
>>> Fraction(1,1).real
Fraction(1, 1)
>>> Fraction(0,1).real
Fraction(0, 1)

__eq__
The returned True:
 >>> Fraction(0,1).real.__eq__(Fraction(0, 1))
True

__ne__
The equal to:
 >>> Fraction(0,1).real.__ne__(Fraction(0, 1))
False

__gt__
The equal to:
 >>> Fraction(0,1).real.__gt__(Fraction(0, 1))
False

__lt__
The equal to following:
 >>> Fraction(0,1).real.__lt__(Fraction(0, 1))
False

__ge__
The equal to following:
 >>> Fraction(0,1).real.__ge__(Fraction(0, 1))
True

__le__
The equal to following results:
 >>> Fraction(0,1).real.__le__(Fraction(0, 1))
True

__add__
Returned to following:
 >>> Fraction(0,1).real.__add__(Fraction(0, 1))
Fraction(0, 1)

__sub__
The equal to following:
 >>> Fraction(0,1).real.__sub__(Fraction(0, 1))
Fraction(0, 1)

__neg__
return negative:
 Fraction(0, 1)
>>> Fraction(2,1).real.__neg__()

__pos__
The values returned positive:
 Fraction(-2, 1)
>>> Fraction(-1,-2).real.__pos__()

__mod__
The returned with the mod.
 >>> Fraction(1,1).real.__mod__(Fraction(1, 1))
Fraction(0, 1)

__truediv__
The division is:
 >>> Fraction(1,1).real.__truediv__(Fraction(1, 1))
Fraction(1, 1)

__floordiv__
The floor division is:
 >>> Fraction(1,1).real.__floordiv__(Fraction(1, 1))
1

Comments