On 22 Feb 2014, at 15:32, Ken Thomases <k...@codeweavers.com> wrote:
>> 
> 
> NSDecimalNumber can represent values that are outside of the range of 
> doubles.  So, _some_ NSDecimalNumber instances _may_ return "d" for double, 
> but others definitely won't.
> 
I don’t think so.
It is possible that this behaviour could change and yes my type hinting system 
would then break.
However, the current behaviour to me seems entirely self consistent.

The NSDecimalNumber header says:
- (const char *)objCType NS_RETURNS_INNER_POINTER;
    // return 'd' for double

If you look in the GNUStep sources (just a vague hint I know, nothing more) 
then the -objCType return is hard coded.

    NSDecimalNumber *maxd = [NSDecimalNumber maximumDecimalNumber] ;
    NSDecimalNumber *mind = [NSDecimalNumber minimumDecimalNumber] ;

    printf("Max double %e \n", DBL_MAX);

    double dmax, dmin;
    [maxd getValue:&dmax];
    [mind getValue:&dmin];

    NSLog(@"max decimal %@ encoding = %s %f", maxd, [maxd objCType], dmax);     
// d
    NSLog(@"max decimal %@ encoding = %s %f", mind, [mind objCType], dmim);     
// d


All the best

Jonathan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to