<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Float field value in scientific notation returns incorrectly in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677232#M38355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The answer is accurate, it's just not precise.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4-byte IEEE floating-point values can't store more than seven significant digits --&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the rest is rounding error.&amp;nbsp; If you need more significant digits, use the 8-byte &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"double" IEEE floating-point datatype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2012 16:56:24 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2012-12-28T16:56:24Z</dc:date>
    <item>
      <title>Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677231#M38354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a value stored in a field (type "float") that is not returning correctly when checked using Arc software (ArcInfo 10.0, sp5). For instance, the following screen shot shows when statistics are run on the AREA field that contains the errant value. Note that all values shown do not have digits in the tens or hundreds places, yet the Sum for the field comes out with a 4 in the tens place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]20272[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The AREA value at issue is for the row "VALUE" = 90. If the value is accessed using a SearchCursor, the mysterious 4 shows up. Here are the results of a SearchCursor on the VALUE and AREA fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Running script GetValueFail...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;11 348300.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21 6800400.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;22 1271700.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;23 153000.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;24 55800.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;41 37431000.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;42 3447000.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;43 1559700.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;52 5323500.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;71 686700.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;81 18106200.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;82 4005900.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;90 80477104.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;95 50004900.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Completed script GetValueFail...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Fri Dec 28 12:12:36 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that while the field shows 8.04771E+07 in ArcCatalog (which would be the correct value), the value that is returned is 80477104.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the table is exported to dbase and viewed in Excel, or if the value is copied from the field and pasted to different software, the value is correct. However, when the value is checked within Arc, the incorrect value is returned. I have also tested this in ArcMap using the Select by Attributes tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The attached zipped folder contains a geodatabase with the table and a toolbox with the script added, the script, the script message, and the exported dbase table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is this value not being returned correctly by Arc software?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 16:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677231#M38354</guid>
      <dc:creator>JeffReinhart2</dc:creator>
      <dc:date>2012-12-28T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677232#M38355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The answer is accurate, it's just not precise.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4-byte IEEE floating-point values can't store more than seven significant digits --&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the rest is rounding error.&amp;nbsp; If you need more significant digits, use the 8-byte &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"double" IEEE floating-point datatype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 16:56:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677232#M38355</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-28T16:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677233#M38356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That makes sense. To go further on the issue, this table was generated from the Zonal Statistics as Table tool. How can I get that tool to calculate area to a higher precision field type?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 17:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677233#M38356</guid>
      <dc:creator>JeffReinhart2</dc:creator>
      <dc:date>2012-12-28T17:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677234#M38357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jeff.m.reinhart&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, why would it randomly return a 4 and not just a zero?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 17:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677234#M38357</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-28T17:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677235#M38358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mkennedy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like the tool will only calculate integers or float values, possibly because the input rasters are either integer or float: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/How_Zonal_Statistics_works/009z000000wt000000/"&gt;How zonal statistics works&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melita&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 18:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677235#M38358</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-28T18:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677236#M38359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Seems to me that since the AREA field is derived from the COUNT field, and would normally result in a much larger number (for instance, a 30x30 meter raster would be COUNT * 900), that the AREA field would more appropriate as a type "DOUBLE".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For now, I just worked around it by deleting the AREA field, adding it back as a type "DOUBLE", and calculating it using the appropriate conversion from the COUNT field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the responses!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 18:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677236#M38359</guid>
      <dc:creator>JeffReinhart2</dc:creator>
      <dc:date>2012-12-28T18:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677237#M38360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "4" isn't random, it's just a remainder. Wikipedia does a better job of describing &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Single_precision" rel="nofollow noopener noreferrer" target="_blank"&gt;IEEE&lt;BR /&gt;encoding&lt;/A&gt;&lt;SPAN&gt; than I can, but at it's core, the encoding divides the mantissa by 2 repeatedly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;storing the 1 or 0, and carrying the rest.&amp;nbsp; When the manitssa is full, it stops.&amp;nbsp; This has the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;effect of truncating the value down, so when it's decoded into a double (which is used for&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; formatting), the extra bits expand to fill the larger mantissa (resulting in a value slightly&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;smaller than the original value).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if you can tell the stats function to use double values in the table, but you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;could reduce the magnitude of the values (change units by 1000) or massage the results&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to truncate insigificant digits using a base10 logarithm --&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;lop = log10(value) - 6;
factor = pow( 10, lop);
value = trunc( value / factor ) * factor;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(or something close -- I didn't check the math).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677237#M38360</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T04:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Float field value in scientific notation returns incorrectly</title>
      <link>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677238#M38361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very interesting response on where the 4 came from! Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's to another workaround! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 18:58:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/float-field-value-in-scientific-notation-returns/m-p/677238#M38361</guid>
      <dc:creator>JeffReinhart2</dc:creator>
      <dc:date>2012-12-28T18:58:39Z</dc:date>
    </item>
  </channel>
</rss>

