<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Float</title>
	<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/</link>
	<description>serious code</description>
	<pubDate>Fri, 21 Nov 2008 13:21:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>

	<item>
		<title>by: corbin</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-433</link>
		<pubDate>Mon, 26 Sep 2005 12:16:50 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-433</guid>
					<description>good job explaining stuff! i was rather astonished at all the float uses in cocoa when i first moved over to macs, but now, it seems second nature. </description>
		<content:encoded><![CDATA[	<p>good job explaining stuff! i was rather astonished at all the float uses in cocoa when i first moved over to macs, but now, it seems second nature.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Big/Complex &raquo; Ridiculous Fish</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-434</link>
		<pubDate>Mon, 26 Sep 2005 13:38:27 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-434</guid>
					<description>[...] 			ridiculous_fish doesn&amp;#8217;t post much, but the posts are always interesting. Take the most recent post, which is about the encoding of floating point numbers. I laughed at this bit: 	 If the man [...]</description>
		<content:encoded><![CDATA[	<p>[...] 			ridiculous_fish doesn&#8217;t post much, but the posts are always interesting. Take the most recent post, which is about the encoding of floating point numbers. I laughed at this bit: 	 If the man [...]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex Rosenberg</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-435</link>
		<pubDate>Mon, 26 Sep 2005 14:04:10 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-435</guid>
					<description>Apple's recent love-affair with floats isn't all a rosy picture. As you've noticed, not everybody really understands the properties of floating-point numbers.

AppKit is just one of many layers of code above CoreGraphics that improperly uses floats. For example, resizing a window vigorously can result in subviews moving ever so slightly around from where they should be. NSSplitView gives all of the fractional portion of a resize to the bottommost pane. This can be seen in FileMerge: slowly grow the window to watch the bottom pane open itself up.

Goldberg's &quot;What Every Computer Scientist Should Know About Floating-Point Arithmetic&quot; should be required reading.  is one place to find it.</description>
		<content:encoded><![CDATA[	<p>Apple&#8217;s recent love-affair with floats isn&#8217;t all a rosy picture. As you&#8217;ve noticed, not everybody really understands the properties of floating-point numbers.</p>
	<p>AppKit is just one of many layers of code above CoreGraphics that improperly uses floats. For example, resizing a window vigorously can result in subviews moving ever so slightly around from where they should be. NSSplitView gives all of the fractional portion of a resize to the bottommost pane. This can be seen in FileMerge: slowly grow the window to watch the bottom pane open itself up.</p>
	<p>Goldberg&#8217;s &#8220;What Every Computer Scientist Should Know About Floating-Point Arithmetic&#8221; should be required reading.  is one place to find it.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Gibbons Burke</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-436</link>
		<pubDate>Mon, 26 Sep 2005 15:24:20 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-436</guid>
					<description>One of the PITA things about floats is that base ten decimals are irrational numbers when represented in binary floating point representations. So 0.5 turns into 0.49999999999999 if you're not careful about it.

There is a very interesting essay on floating point number, rounding, overflow and underflow and numeric representation in general and SANE (Standard Apple Numerics Environment) in the preface to the &quot;Apple Numerics Manual&quot;, second edition. Reading, MA: Addison-Wesley, 1988 by William Kahan a professor at Berkeley.

Kahan's similar but less humorous essay on the IEEE 754 standard is found here:

   http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF

and his web page is full of papers on the subject:

   http://www.cs.berkeley.edu/~wkahan/

The original essay isn't found in Apple's successor document which might, however, be interesting to people following this topic:

Inside Macintosh: PowerPC Numerics
http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf</description>
		<content:encoded><![CDATA[	<p>One of the PITA things about floats is that base ten decimals are irrational numbers when represented in binary floating point representations. So 0.5 turns into 0.49999999999999 if you&#8217;re not careful about it.</p>
	<p>There is a very interesting essay on floating point number, rounding, overflow and underflow and numeric representation in general and SANE (Standard Apple Numerics Environment) in the preface to the &#8220;Apple Numerics Manual&#8221;, second edition. Reading, MA: Addison-Wesley, 1988 by William Kahan a professor at Berkeley.</p>
	<p>Kahan&#8217;s similar but less humorous essay on the IEEE 754 standard is found here:</p>
	<p>   <a href='http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF' rel='nofollow'>http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF</a></p>
	<p>and his web page is full of papers on the subject:</p>
	<p>   <a href='http://www.cs.berkeley.edu/~wkahan/' rel='nofollow'>http://www.cs.berkeley.edu/~wkahan/</a></p>
	<p>The original essay isn&#8217;t found in Apple&#8217;s successor document which might, however, be interesting to people following this topic:</p>
	<p>Inside Macintosh: PowerPC Numerics<br />
<a href='http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf' rel='nofollow'>http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Wim L</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-437</link>
		<pubDate>Mon, 26 Sep 2005 15:31:01 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-437</guid>
					<description>I agree... Apple's occasional overuse of floats (and doubles) bothers me too. The fact that, in floating point arithmetic, you can't assume that (A+B)-B==A causes lots of subtle bugs, and the nonuniformity of floating-point values makes them a bad choice for CFAbsoluteTime.

On the other hand, C has no direct support for fixed-point types, which would be the Right Way ( ;-) ) to do a lot of the things done with floats here.

On the gripping hand, floats are almost-good-enough, almost-all-the-time...</description>
		<content:encoded><![CDATA[	<p>I agree... Apple&#8217;s occasional overuse of floats (and doubles) bothers me too. The fact that, in floating point arithmetic, you can&#8217;t assume that (A+B)-B==A causes lots of subtle bugs, and the nonuniformity of floating-point values makes them a bad choice for CFAbsoluteTime.</p>
	<p>On the other hand, C has no direct support for fixed-point types, which would be the Right Way ( ;-) ) to do a lot of the things done with floats here.</p>
	<p>On the gripping hand, floats are almost-good-enough, almost-all-the-time...
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Reinder</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-438</link>
		<pubDate>Mon, 26 Sep 2005 15:33:20 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-438</guid>
					<description>&quot;Quickdraw used integer coordinates, and Quartz switched to floating point&quot;.

You forget (or don't know about) QuickDraw GX, which used fixed-point coordinates (16.16)</description>
		<content:encoded><![CDATA[	<p>&#8220;Quickdraw used integer coordinates, and Quartz switched to floating point&#8221;.</p>
	<p>You forget (or don&#8217;t know about) QuickDraw GX, which used fixed-point coordinates (16.16)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kevin Packard</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-439</link>
		<pubDate>Tue, 27 Sep 2005 10:06:16 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-439</guid>
					<description>CoreGraphics prefers to manipulate graphics in vector format.  To be useful (that is, to print or display onscreen), vectors must be rastered.  However, once rastered, some precision is lost, so Quartz doesn't raster until it absolutely must.

Likewise, maybe we need a numeric type which can be operated on, but doesn't resolve precision until the very last moment.  Its value would be stored as a series of equations which would not resolve until asked, at which point the asker will know the precision he needs.  This must be how Mathematica works...?

I dub thee CoreMath™.</description>
		<content:encoded><![CDATA[	<p>CoreGraphics prefers to manipulate graphics in vector format.  To be useful (that is, to print or display onscreen), vectors must be rastered.  However, once rastered, some precision is lost, so Quartz doesn&#8217;t raster until it absolutely must.</p>
	<p>Likewise, maybe we need a numeric type which can be operated on, but doesn&#8217;t resolve precision until the very last moment.  Its value would be stored as a series of equations which would not resolve until asked, at which point the asker will know the precision he needs.  This must be how Mathematica works...?</p>
	<p>I dub thee CoreMath™.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Michael Tsai - Blog  -  Floating Point</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-440</link>
		<pubDate>Tue, 27 Sep 2005 10:54:17 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-440</guid>
					<description>[...] ng Point 	 	       	 	 	 	 	        Tuesday, September 27, 2005	  Floating Point  Peter Ammon:     So, as a Mac programmer, I should really get a good handle on these floating point th [...]</description>
		<content:encoded><![CDATA[	<p>[...] ng Point 	 	       	 	 	 	 	        Tuesday, September 27, 2005	  Floating Point<br />
 Peter Ammon:</p>
	<p> So, as a Mac programmer, I should really get a good handle on these<br />
 floating point th [...]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Dominik Wagner</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-442</link>
		<pubDate>Tue, 27 Sep 2005 16:02:05 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-442</guid>
					<description>one interesting side note on floats and unexpected results. currently in ruby, (4.10 * 100).to_i returns 409 
http://blog.leetsoft.com/articles/2005/09/27/wtf</description>
		<content:encoded><![CDATA[	<p>one interesting side note on floats and unexpected results. currently in ruby, (4.10 * 100).to_i returns 409<br />
<a href='http://blog.leetsoft.com/articles/2005/09/27/wtf' rel='nofollow'>http://blog.leetsoft.com/articles/2005/09/27/wtf</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Dominik Wagner</title>
		<link>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-443</link>
		<pubDate>Tue, 27 Sep 2005 16:12:35 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2005/09/26/float/#comment-443</guid>
					<description>Kevin:
One not so nice side effect in quartz graphics is, that little white lines on the edges between objects can easily be produced. This is not good. I don't know if this is due to the late rasterisation, or simply due to bad anti-aliasing, but it is kind of unprofessional. You can try yourself in e.g. keynote. draw adjacent rectangles without lines.... and i doubt that the edge points have different coords. I'll write a bug report soon with sample code that shows this....</description>
		<content:encoded><![CDATA[	<p>Kevin:<br />
One not so nice side effect in quartz graphics is, that little white lines on the edges between objects can easily be produced. This is not good. I don&#8217;t know if this is due to the late rasterisation, or simply due to bad anti-aliasing, but it is kind of unprofessional. You can try yourself in e.g. keynote. draw adjacent rectangles without lines.... and i doubt that the edge points have different coords. I&#8217;ll write a bug report soon with sample code that shows this....
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
