/*

 * DoubleValueTest.m - demonstrate [NSString doubleValue] behaviour with large number of significant digits.
 *
 *  Created on: Nov 27, 2014
 */

#import <Foundation/Foundation.h>


int main(void) {
    id arp = [[NSAutoreleasePool alloc] init];

	NSString* stringValue;

	stringValue = @"50.6468746467461646";
    printf ("String %s -> doubleValue = %.18g\n", [stringValue lossyCString], [stringValue doubleValue]);

	stringValue = @"50.64687464674616461";
    printf ("String %s -> doubleValue = %.18g\n", [stringValue lossyCString], [stringValue doubleValue]);

    stringValue = @"0.646874646746164616898211";
    printf ("String %s -> doubleValue = %.18g\n", [stringValue lossyCString], [stringValue doubleValue]);

	stringValue = @"502.6468746467461646";
    printf ("String %s -> doubleValue = %.18g\n", [stringValue lossyCString], [stringValue doubleValue]);

	stringValue = @"502.646874646746164";
    printf ("String %s -> doubleValue = %.18g\n", [stringValue lossyCString], [stringValue doubleValue]);

    [arp release]; arp = nil;

    return 0;
}

