Re: [Pyobjc-dev] NSDecimalNumber to the next level
Brought to you by:
ronaldoussoren
From: Pierce T.W. I. <pi...@tw...> - 2004-03-10 17:09:30
|
On Mar 10, 2004, at 9:15 AM, Ronald Oussoren wrote: > > On 10-mrt-04, at 17:08, Pierce T.Wetter III wrote: > >>> >>> I completely forgot to mention that the usual numeric operators do >>> work correctly, as long as you manually convert floats to NSDecimal, >>> e.g. ``NSDecimalNumber.zero() + 4`` is valid code and will do what >>> you want. >> >> Hmmm.... That must have changed, because I submitted a change which >> you accepted awhile back to not implicitly convert. Checking... >> >> >>> print type(Foundation.NSDecimalNumber.zero()) >> <type 'float'> >> >> Arrgh, its converting again. That works because Python converted it >> implicitly to a float. (Which is actually kind of surprising, since I >> thought it had stopped doing that. See comment for (Bug #831774) in >> objc/objc_support.m) > > You're using the wrong version of PyObjC: > > >>> type (Foundation.NSDecimalNumber.zero()) > <objective-c class NSDecimalNumber at 0xa0a061f4> Doh! Pierce |