The difference between the double and float datatypes in a File Geodatabase is that a float is comprised of 4 bytes of storage space, where as the double is twice as large, 8 bytes.
This means that the possible span of values is much larger for doubles than for floats:
Float: approximately -3.4E38 to 1.2E38
Double: approximately -2.2E308 to 1.8E308
As long as your values are e.g. inside the range of a float, there should be no difference to storing those values as either floats or doubles, except for the storage space.
What you're observing is due to rounding issues, it's incredibly common and this site explains it fairly well: https://floating-point-gui.de/
The difference between the double and float datatypes in a File Geodatabase is that a float is comprised of 4 bytes of storage space, where as the double is twice as large, 8 bytes.
This means that the possible span of values is much larger for doubles than for floats:
Float: approximately -3.4E38 to 1.2E38
Double: approximately -2.2E308 to 1.8E308
As long as your values are e.g. inside the range of a float, there should be no difference to storing those values as either floats or doubles, except for the storage space.
What you're observing is due to rounding issues, it's incredibly common and this site explains it fairly well: https://floating-point-gui.de/
Hi,
thank you very much for you answer and the very interesting link. The goal of the exercise would be precisely to have all the features stored into float to save space. So (if I got it right) my exemple feature with a value of 2603368.3700000001 is inside both ranges. The question now is why when I write them into the target GDB I loose all the decimals?
Hi,
thank you very much for you answer and the very interesting link. The goal of the exercise would be precisely to have all the features stored into float to save space. So (if I got it right) my exemple feature with a value of 2603368.3700000001 is inside both ranges. The question now is why when I write them into the target GDB I loose all the decimals?
I couldn't tell without more details. Are you able to post a minimal workspace here that demonstrates the issue?
I couldn't tell without more details. Are you able to post a minimal workspace here that demonstrates the issue?
The workspace is actually very simple, just a reader and a writer. The thing is that it looks like that attribute must be defined as a double, if it's defined as float it just doesnt work...
https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/arcgis-field-data-types.htm