<?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 Never use the float data type in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/never-use-the-float-data-type/m-p/19227#M12868</link>
    <description>&lt;P&gt;select float('92233464567.33') returns &lt;/P&gt;&lt;P&gt;92,233,466,000&lt;/P&gt;&lt;P&gt;I am expected result will be around 92,233,464,567.xx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;therefore, float data type should be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use double or decimal works as expected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I see float data type is widely used assuming most numeric values are &amp;lt; 1 billion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1824i573D21A785BC3641/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 23:11:53 GMT</pubDate>
    <dc:creator>lizou</dc:creator>
    <dc:date>2022-05-30T23:11:53Z</dc:date>
    <item>
      <title>Never use the float data type</title>
      <link>https://community.databricks.com/t5/data-engineering/never-use-the-float-data-type/m-p/19227#M12868</link>
      <description>&lt;P&gt;select float('92233464567.33') returns &lt;/P&gt;&lt;P&gt;92,233,466,000&lt;/P&gt;&lt;P&gt;I am expected result will be around 92,233,464,567.xx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;therefore, float data type should be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use double or decimal works as expected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I see float data type is widely used assuming most numeric values are &amp;lt; 1 billion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1824i573D21A785BC3641/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 23:11:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/never-use-the-float-data-type/m-p/19227#M12868</guid>
      <dc:creator>lizou</dc:creator>
      <dc:date>2022-05-30T23:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Never use the float data type</title>
      <link>https://community.databricks.com/t5/data-engineering/never-use-the-float-data-type/m-p/19228#M12869</link>
      <description>&lt;P&gt;Float&amp;nbsp;is Approximate-number data type, which means that not all values in the data type range can be represented exactly.&lt;/P&gt;&lt;P&gt;Decimal/Numeric&amp;nbsp;is Fixed-Precision data type, which means that all the values in the data type range can be represented exactly with precision and scale.&lt;/P&gt;&lt;P&gt;So its always better you use Decimal instead of float.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:31:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/never-use-the-float-data-type/m-p/19228#M12869</guid>
      <dc:creator>Prabakar</dc:creator>
      <dc:date>2022-05-31T13:31:06Z</dc:date>
    </item>
  </channel>
</rss>

