<?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: Cocoa Tutorial: Don&#8217;t Be Lazy With NSDecimalNumber (Like Me)</title>
	<atom:link href="http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/</link>
	<description>Taglines are for Windows programmers</description>
	<lastBuildDate>Mon, 26 Jul 2010 16:50:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: mj1531</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-1191</link>
		<dc:creator>mj1531</dc:creator>
		<pubDate>Fri, 17 Apr 2009 22:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-1191</guid>
		<description>&lt;p&gt;Nevermind, I figured it out.  The precision refers to the number of digits after the decimal point and the calculation of the mantissa should read:&lt;/p&gt;

&lt;p&gt;mantissa = (yourPrimitive * 10^precision)&lt;/p&gt;

&lt;p&gt;Thanks for this informative post.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nevermind, I figured it out.  The precision refers to the number of digits after the decimal point and the calculation of the mantissa should read:</p>

<p>mantissa = (yourPrimitive * 10^precision)</p>

<p>Thanks for this informative post.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: mj1531</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-1190</link>
		<dc:creator>mj1531</dc:creator>
		<pubDate>Fri, 17 Apr 2009 21:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-1190</guid>
		<description>&lt;p&gt;In converting primitives to the mantissa/exponent format, you mention precision.  Is this the same value as the scale in NSDecimalNumberBehaviors, or is it a printf-style float-precision specifier (like 4.3 for 4 places before the decimal point and 3 after)?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In converting primitives to the mantissa/exponent format, you mention precision.  Is this the same value as the scale in NSDecimalNumberBehaviors, or is it a printf-style float-precision specifier (like 4.3 for 4 places before the decimal point and 3 after)?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-724</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Mon, 30 Jun 2008 05:53:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-724</guid>
		<description>&lt;p&gt;dpenny,&lt;/p&gt;

&lt;p&gt;Yes they are designed for currency use and the proper rounding of decimal points.  They solve the issues with floating point math.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>dpenny,</p>

<p>Yes they are designed for currency use and the proper rounding of decimal points.  They solve the issues with floating point math.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: dpenny</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-723</link>
		<dc:creator>dpenny</dc:creator>
		<pubDate>Mon, 30 Jun 2008 02:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-723</guid>
		<description>&lt;p&gt;I cam across this article just as I was writing a small app the deals with currency as well.  It seems that historically wisdom has said to always convert any currency value to a whole integer before doing any calculations with, does NSDecimalNumber alleviate the need for doing this?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I cam across this article just as I was writing a small app the deals with currency as well.  It seems that historically wisdom has said to always convert any currency value to a whole integer before doing any calculations with, does NSDecimalNumber alleviate the need for doing this?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-574</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Mon, 28 Apr 2008 21:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-574</guid>
		<description>&lt;p&gt;I would not recommend even doing that.  There is a reason that the NSDecimalNumber is configured differently and has an unusual constructor.  Ignoring that seems foolish just to save a couple of characters typing.&lt;/p&gt;

&lt;p&gt;Definitely sounds like the wrong kind of lazy to me :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I would not recommend even doing that.  There is a reason that the NSDecimalNumber is configured differently and has an unusual constructor.  Ignoring that seems foolish just to save a couple of characters typing.</p>

<p>Definitely sounds like the wrong kind of lazy to me :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jediknil</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-573</link>
		<dc:creator>jediknil</dc:creator>
		<pubDate>Fri, 25 Apr 2008 22:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-573</guid>
		<description>&lt;p&gt;Ah, OK. In that case -initWithDouble: and friends are still valid initializers (with no warnings), and they of course give you NSDecimalNumbers.&lt;/p&gt;

&lt;p&gt;On the other hand, for doing base-10 arithmetic, you&#039;re probably right not to use -initWithDouble:, since NSDecimalNumber&#039;s internal representation uses base-10 exponents, while primitive floats and doubles of course use base-2 exponents, and there could be some (slight) loss of precision.&lt;/p&gt;

&lt;p&gt;For integers, though, I&#039;d still prefer [[NSDecimalNumber alloc] initWithInteger:100] to [[NSDecimalNumber alloc] initWithMantissa:1 exponent:2 isNegative:NO].&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ah, OK. In that case -initWithDouble: and friends are still valid initializers (with no warnings), and they of course give you NSDecimalNumbers.</p>

<p>On the other hand, for doing base-10 arithmetic, you&#8217;re probably right not to use -initWithDouble:, since NSDecimalNumber&#8217;s internal representation uses base-10 exponents, while primitive floats and doubles of course use base-2 exponents, and there could be some (slight) loss of precision.</p>

<p>For integers, though, I&#8217;d still prefer [[NSDecimalNumber alloc] initWithInteger:100] to [[NSDecimalNumber alloc] initWithMantissa:1 exponent:2 isNegative:NO].</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-572</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Fri, 25 Apr 2008 14:39:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-572</guid>
		<description>&lt;p&gt;jediknil,&lt;/p&gt;

&lt;p&gt;Since NSDecimalNumber *test = [NSDecimalNumber numberWithDouble:9.5]; will produce a warning it is not recommended.  When dealing with NSDecimalNumber objects it is much safer to use the recognized initializers and avoid the ones from its NSNumber parent class.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>jediknil,</p>

<p>Since NSDecimalNumber *test = [NSDecimalNumber numberWithDouble:9.5]; will produce a warning it is not recommended.  When dealing with NSDecimalNumber objects it is much safer to use the recognized initializers and avoid the ones from its NSNumber parent class.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jediknil</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-570</link>
		<dc:creator>jediknil</dc:creator>
		<pubDate>Fri, 25 Apr 2008 04:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-570</guid>
		<description>&lt;p&gt;NSDecimalNumber also supports the various +numberWith(Primitive): methods that come with NSNumber. And yes, they correctly return an NSDecimalNumber.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>NSDecimalNumber also supports the various +numberWith(Primitive): methods that come with NSNumber. And yes, they correctly return an NSDecimalNumber.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Ahlman</title>
		<link>http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/comment-page-1/#comment-569</link>
		<dc:creator>Sebastian Ahlman</dc:creator>
		<pubDate>Fri, 25 Apr 2008 04:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=106#comment-569</guid>
		<description>&lt;p&gt;Thanks for the tip!&lt;/p&gt;

&lt;p&gt;Great blog BTW. I recently started programming with Cocoa and I have found CIMGF to be a valuable resource. Keep it up and I will keep reading!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the tip!</p>

<p>Great blog BTW. I recently started programming with Cocoa and I have found CIMGF to be a valuable resource. Keep it up and I will keep reading!</p>]]></content:encoded>
	</item>
</channel>
</rss>
