<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Java on Tomasz Półgrabia</title><link>https://polgrabia.me/tags/java/</link><description>Recent content in Java on Tomasz Półgrabia</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 12 Mar 2025 00:20:58 +0200</lastBuildDate><atom:link href="https://polgrabia.me/tags/java/index.xml" rel="self" type="application/rss+xml"/><item><title>BigDecimal - why do we need it?</title><link>https://polgrabia.me/posts/20250312-bigdecimal-why-do-we-need/</link><pubDate>Wed, 12 Mar 2025 00:20:58 +0200</pubDate><guid>https://polgrabia.me/posts/20250312-bigdecimal-why-do-we-need/</guid><description>&lt;h2 id="why-do-we-need-it"&gt;Why do we need it?&lt;/h2&gt;&#10;&lt;p&gt;This question is the pretty standard one in algorithmic interview questions. So, why do we need it? I think it&amp;rsquo;s fair to ask.&#10;The main reason behind this is knowing how floating point numbers are being stored. Usually, you don&amp;rsquo;t need it to use&#10;this knowledge otherwise to know &amp;ldquo;solution&amp;rdquo; but it&amp;rsquo;s good to know.&lt;/p&gt;&#10;&lt;p&gt;The main reason is the precision or rather, the lack of it. In environments where we need to have big numbers very precise like&#10;face values and when it&amp;rsquo;s multiplied by exchange ratios, the potential difference can be very signifcant. Therefore potential&#10;financial risk can be signifcant, too.&lt;/p&gt;</description></item></channel></rss>