Skip to content
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

value conversion bug for relatively large numbers #57

Open
wenchenvincent opened this issue Jan 10, 2018 · 3 comments
Open

value conversion bug for relatively large numbers #57

wenchenvincent opened this issue Jan 10, 2018 · 3 comments

Comments

@wenchenvincent
Copy link

I was trying to create data tables from Python list of list. I found that there was a problem with importing the values correctly for some relatively large numbers. It seemed that there was bug when creating a Continunous Value with relatively large numbers. For example

Orange.data.Value(Orange.feature.Continuous(),308632021)

This construction will give me the following Value:
<orange.Value ''='308632032.000'>

It seems that for relatively large numbers, the conversion would usually be wrong but in a way that is not like an overflow.

@ales-erjavec
Copy link
Contributor

The values are stored as 32-bit floats internally. They have precision of 24 significant bits meaning they cannot (generally) represent integer values larger then 16777216.

For instance this will fail at the last line

 assert np.float32(2 ** 24 - 1) == 2 ** 24 - 1
 assert np.float32(2 ** 24 ) == 2 ** 24
 assert np.float32(2 ** 24 + 1 ) == 2 ** 24 + 1

@wenchenvincent
Copy link
Author

Thank you for the answer! Is there any option that we can choose to represent the numbers as double precision?

@ales-erjavec
Copy link
Contributor

I am afraid not.

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

No branches or pull requests

2 participants