<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Strangest bug I've ever since]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4886</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4886&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Strangest bug I've ever since.]]></description>
		<lastBuildDate>Sat, 12 Apr 2014 15:54:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Strangest bug I've ever since]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19714#p19714</link>
			<description><![CDATA[<p>Yes, it&#039;s about precision. The way how computer store floating point. See here for <br /><a href="http://www.leaseweblabs.com/2013/06/the-php-floating-point-precision-is-wrong-by-default/">http://www.leaseweblabs.com/2013/06/the … y-default/</a></p><p>and here<br /><a href="http://www.php.net/manual/en/language.types.float.php">http://www.php.net/manual/en/language.types.float.php</a></p><p>lesson learned from php.net link:<br />&quot;So never trust floating number results to the last digit, and do not compare floating point numbers directly for equality.&quot;</p>]]></description>
			<author><![CDATA[null@example.com (mfaa98)]]></author>
			<pubDate>Sat, 12 Apr 2014 15:54:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19714#p19714</guid>
		</item>
		<item>
			<title><![CDATA[Re: Strangest bug I've ever since]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19713#p19713</link>
			<description><![CDATA[<p>Yes, it&#039;s the rounding issue. But, I already print the $x which is exactly same as 0.84.</p>]]></description>
			<author><![CDATA[null@example.com (barbarian)]]></author>
			<pubDate>Sat, 12 Apr 2014 00:15:29 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19713#p19713</guid>
		</item>
		<item>
			<title><![CDATA[Re: Strangest bug I've ever since]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19710#p19710</link>
			<description><![CDATA[<p>I&#039;m not a programmer so don&#039;t be insulted if this doesn&#039;t help you but you simply have a rounding issue. 1.1102230246252E-16 is technically 0.00000000000000001102230246252 which for anyone&#039;s purpose is 0.</p><p>I&#039;m not sure if you have something in the logger function that could be doing it but could you just add an operation to truncate some decimal places before the final result? Sorry if that doesn&#039;t help.</p>]]></description>
			<author><![CDATA[null@example.com (hansenb88)]]></author>
			<pubDate>Fri, 11 Apr 2014 13:53:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19710#p19710</guid>
		</item>
		<item>
			<title><![CDATA[Strangest bug I've ever since]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19708#p19708</link>
			<description><![CDATA[<p>I don&#039;t know how to explain this. I&#039;m still confused with this bug. I have some strange bug and I&#039;m trying to debugging until I found the root problem. I&#039;ve just try some simple substraction but it gives me strange result. Here is my code:</p><div class="codebox"><pre><code>$x = 0.56*1.5;
logger($x-0.84);</code></pre></div><p>What I expection is 0, but the result is : 1.1102230246252E-16</p><p>If you want to know what is logger function, it&#039;s some function that I create to echo the parameter. The stranger thing is, this bug only happen to 2 decimal place operation. If I try with</p><div class="codebox"><pre><code>$x = 0.5*1.5;
logger($x-0.75);</code></pre></div><p>It works fine. I already check the variable type. Both show me they are double. Can anyone hlep me?</p>]]></description>
			<author><![CDATA[null@example.com (barbarian)]]></author>
			<pubDate>Fri, 11 Apr 2014 12:55:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19708#p19708</guid>
		</item>
	</channel>
</rss>
