#415 Editing double field adds extra decimals

Core (462)
Jeff Moody

I'm using a Derby database.
When trying to manually edit a field that is created as
a float, it isn't quite working correctly.
Steps to reproduce:
1. Connect to the db
2. Select a table (in the "Objects" tab) with a field
that is created as a float and has at least 1 record in it
3. Select the Content tab
4. Right click on the viewed table, select "Make Editable"
5. Edit the value of a float field, entering 0.1
6. Select a different table
7. Select the table that was just edited

Notice that the value edited is now 0.10000000149011612.

I would suspect this is related to the way Java handles
converting from float to double. I.e. if you declare a
variable as a float, then cast to a double, the number
may change.
Consider the following code:
float f = 0.1f;
double d = f;

At this point:
d = 0.10000000149011612

I'm using Java 1.4.2_11


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks