• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to create an NSDecimal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create an NSDecimal?


  • Subject: Re: How to create an NSDecimal?
  • From: WT <email@hidden>
  • Date: Sun, 15 Mar 2009 05:56:51 +0100

On Mar 15, 2009, at 1:50 AM, Michael Vannorsdel wrote:

The only other way is to do it is manually by setting the struct members.

typedef struct {
	signed int _exponent:8;
	unsigned int _length:4;
	unsigned int _isNegative:1;
	unsigned int _isCompact:1;
	unsigned int _reserved:18;
	unsigned short _mantissa[NSDecimalMaxSize];
} NSDecimal;

I don't think so. As I pointed out in my original post, the struct fields are private, according to "Foundation Data Types Reference". I don't know if Obj-C enforces a restriction such as struct fields being private but if it doesn't, I'd rather not write code that could break in the future if Apple decides to change the struct.


I'll stick with creating an NSDecimalNumber and then extracting the NSDecimal struct using -decimalValue.

Thanks to everyone who contributed to answer my question.
Wagner
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to create an NSDecimal? (From: WT <email@hidden>)
 >Re: How to create an NSDecimal? (From: Ashley Clark <email@hidden>)
 >Re: How to create an NSDecimal? (From: Luca Pazzerello <email@hidden>)
 >Re: How to create an NSDecimal? (From: Ashley Clark <email@hidden>)
 >Re: How to create an NSDecimal? (From: Keary Suska <email@hidden>)
 >Re: How to create an NSDecimal? (From: Michael Ash <email@hidden>)
 >Re: How to create an NSDecimal? (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: Performance problem with GC enabled
  • Next by Date: Re: iPhone UIWebView height?
  • Previous by thread: Re: How to create an NSDecimal?
  • Next by thread: Re: How to create an NSDecimal?
  • Index(es):
    • Date
    • Thread