Skip to content

Implement float is_integer method #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DoDaek opened this issue Oct 1, 2019 · 1 comment
Open

Implement float is_integer method #111

DoDaek opened this issue Oct 1, 2019 · 1 comment
Assignees

Comments

@DoDaek
Copy link
Contributor

DoDaek commented Oct 1, 2019

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
Copy link
Contributor Author

DoDaek commented Oct 2, 2019

@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'"
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants