gpython icon indicating copy to clipboard operation
gpython copied to clipboard

Implement float is_integer method

Open DoDaek opened this issue 6 years ago • 1 comments

python

>>> a = 10.0
>>> type(a)
<class 'float'>
>>> a.is_integer()
True

gpython

>>> a = 10.0
>>> type(a)
<class 'float'>
>>> a.is_integer()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
AttributeError: "'float' has no attribute 'is_integer'"

is_integer() method does not exist.

DoDaek avatar Oct 01 '19 11:10 DoDaek

@corona10 There are built-in functions that are not implemented. Can I implement them and send PR?

For example ##python

>>> a = 0.875
>>> a.as_integer_ratio()
(7, 8)
>>>

gpython

>>> a = 0.875
>>> a.as_integer_ratio()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
AttributeError: "'float' has no attribute 'as_integer_ratio'"
>>>

DoDaek avatar Oct 02 '19 10:10 DoDaek