<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>writing &#124; ben fry &#187; series</title>
	<atom:link href="http://benfry.com/writing/archives/category/series/feed" rel="self" type="application/rss+xml" />
	<link>http://benfry.com/writing</link>
	<description>Visualizing Data</description>
	<lastBuildDate>Sat, 05 Nov 2011 18:57:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The minimum, the maximum, and the typos therein</title>
		<link>http://benfry.com/writing/archives/19</link>
		<comments>http://benfry.com/writing/archives/19#comments</comments>
		<pubDate>Tue, 26 Feb 2008 19:44:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[series]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[vida]]></category>

		<guid isPermaLink="false">http://benfry.com/writing/archives/19</guid>
		<description><![CDATA[Blake Tregre found a typo on page 55 of Visualizing Data in one of the comments:

// Set the value of m arbitrarily high, so the first value
// found will be set as the maximum.
float m = MIN_FLOAT;
That should instead read something like:

// Set the value of m to the lowest possible value,
// so that the [...]]]></description>
			<content:encoded><![CDATA[<p>Blake Tregre found a typo on page 55 of Visualizing Data in one of the comments:</p>
<pre>
// Set the value of m arbitrarily high, so the first value
// found will be set as the maximum.
float m = MIN_FLOAT;</pre>
<p>That should instead read something like:</p>
<pre>
// Set the value of m to the <em>lowest possible</em> value,
// so that the first value found will automatically be larger.
float m = MIN_FLOAT;</pre>
<p>This also reminds me that the Table class used in chapter 4, makes use of <tt>Float.MAX_VALUE</tt> and <tt>-Float.MAX_VALUE</tt>, which are inherited from Java. Processing has constants named <tt>MAX_FLOAT</tt> and <tt>MIN_FLOAT</tt> that do the same thing. We added the constants because <tt>-Float.MAX_VALUE</tt> seems like especially awkward syntax when you&#8217;re just trying to get the smallest possible float. The Table class was written sometime before the constants were added to the Processing syntax, so they use the Java approach.</p>
<p>There is a <tt>Float.MIN_VALUE</tt> in Java, however the spec does a very unfortunate thing, because <tt>MIN_VALUE</tt> is defined as &#8220;A constant holding the smallest positive nonzero value of type float&#8221;, which sounds promising until you realize that it just means a very tiny positive number, not the <em>minimum</em> possible value for float. It&#8217;s not clear why they thought this would be a more useful constant (or useful at all).</p>
<p>And to make things even more confusing, <tt>Integer.MAX_VALUE</tt> and <tt>Integer.MIN_VALUE</tt> behave more like the way you might expect, where the <tt>MIN_VALUE</tt> is in fact that the lowest (most negative) value for an int. Had they used the same definition as <tt>Float.MIN_VALUE</tt>, then <tt>Integer.MIN_VALUE</tt> would equal 1. Which illustrates just how silly it is to do that for the Float class.</p>
]]></content:encoded>
			<wfw:commentRss>http://benfry.com/writing/archives/19/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

