<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Erlang Integers</title>
	<atom:link href="http://www.programmersparadox.com/2008/02/05/erlang-integers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.programmersparadox.com/2008/02/05/erlang-integers/</link>
	<description>Long form thoughts from a Software Engineer</description>
	<lastBuildDate>Thu, 19 Jan 2012 13:42:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mark</title>
		<link>http://www.programmersparadox.com/2008/02/05/erlang-integers/comment-page-1/#comment-2207</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 13 Jan 2009 04:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.programmersparadox.com/2008/02/05/erlang-integers/#comment-2207</guid>
		<description>Thanks Nic.  I didn&#039;t realize there were limitations in Erlang based around this.  I wonder now if other languages face the same issues, and if so, which ones.</description>
		<content:encoded><![CDATA[<p>Thanks Nic.  I didn&#8217;t realize there were limitations in Erlang based around this.  I wonder now if other languages face the same issues, and if so, which ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nic</title>
		<link>http://www.programmersparadox.com/2008/02/05/erlang-integers/comment-page-1/#comment-2206</link>
		<dc:creator>Nic</dc:creator>
		<pubDate>Mon, 12 Jan 2009 22:28:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.programmersparadox.com/2008/02/05/erlang-integers/#comment-2206</guid>
		<description>Arbitrary-sized integer is nice but poorly supported in Erlang. 
If one only uses additions or multiplications its okay but 
integer power arithmetic operation is not supported. So it
is untrue to say that Erlang can do integer arithmetic of
arbitrary length integers. Even worse, it does not warns you
when it produces a wrong answer. Try the following:
    1&gt; math:pow(2,55).
    36028797018963970.0
Obviously no integral power of 2 can end by 0.
All integral powers of 2 larger than 55 will give you a result
ending by zero. This is because Erlang has not implemented
an integer power function and relies on a float pow(x,y) function.
This is why the result is a float. Actually it is an IEEE-754 float
number in decimal64 format which means it has a maximum
precision of 16 digits.
Many applications dealing with large integers require true
large integer arithmetic (including power), for example
cryptology applications routinely do arithmetic modular
power operations on very large integers. Though Erlang 
allows to write arbitrary large integers and do some basic
operations it surely cannot be said to support arlitrary large
integer arithmetic. For that, one can use mathematica (does
arbitrary large float arithmetic as well) or specialized packages
such as simod/modsim.</description>
		<content:encoded><![CDATA[<p>Arbitrary-sized integer is nice but poorly supported in Erlang.<br />
If one only uses additions or multiplications its okay but<br />
integer power arithmetic operation is not supported. So it<br />
is untrue to say that Erlang can do integer arithmetic of<br />
arbitrary length integers. Even worse, it does not warns you<br />
when it produces a wrong answer. Try the following:<br />
    1&gt; math:pow(2,55).<br />
    36028797018963970.0<br />
Obviously no integral power of 2 can end by 0.<br />
All integral powers of 2 larger than 55 will give you a result<br />
ending by zero. This is because Erlang has not implemented<br />
an integer power function and relies on a float pow(x,y) function.<br />
This is why the result is a float. Actually it is an IEEE-754 float<br />
number in decimal64 format which means it has a maximum<br />
precision of 16 digits.<br />
Many applications dealing with large integers require true<br />
large integer arithmetic (including power), for example<br />
cryptology applications routinely do arithmetic modular<br />
power operations on very large integers. Though Erlang<br />
allows to write arbitrary large integers and do some basic<br />
operations it surely cannot be said to support arlitrary large<br />
integer arithmetic. For that, one can use mathematica (does<br />
arbitrary large float arithmetic as well) or specialized packages<br />
such as simod/modsim.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.programmersparadox.com/2008/02/05/erlang-integers/comment-page-1/#comment-72</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 06 Feb 2008 05:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.programmersparadox.com/2008/02/05/erlang-integers/#comment-72</guid>
		<description>Yeah.. Ruby does this too... Fixnum gets promoted to Bignum.</description>
		<content:encoded><![CDATA[<p>Yeah.. Ruby does this too&#8230; Fixnum gets promoted to Bignum.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: P O'Grady</title>
		<link>http://www.programmersparadox.com/2008/02/05/erlang-integers/comment-page-1/#comment-70</link>
		<dc:creator>P O'Grady</dc:creator>
		<pubDate>Tue, 05 Feb 2008 21:10:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.programmersparadox.com/2008/02/05/erlang-integers/#comment-70</guid>
		<description>Python has this too: if a whole number value grows past the native integer size, it promotes it to a long integer; and http://docs.python.org/lib/typesnumeric.html states that &quot;Long integers have unlimited precision.&quot;</description>
		<content:encoded><![CDATA[<p>Python has this too: if a whole number value grows past the native integer size, it promotes it to a long integer; and <a href="http://docs.python.org/lib/typesnumeric.html" rel="nofollow">http://docs.python.org/lib/typesnumeric.html</a> states that &#8220;Long integers have unlimited precision.&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

