User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsnumber.h:doublevalue

doubleValue

 
- (double)doubleValue;
 

Returns the receiver’s value.

Return Value - The receiver’s value as datatyp, converting it as necessary.

ObjC Sourcecode Example

    //** Sample Datatype **
    double myDouble = 3.14;
 
    //** Initializing NSNumber Object **
    NSNumber *myDoubleNumber = [[NSNumber alloc]initWithDouble:myDouble];
 
    //**  To access your value use doubleValue **
    if ([myDoubleNumber doubleValue] == 3.14) {
 
        NSLog(@"myDoubleNumber: %@", myDoubleNumber);
        NSLog(@"myDouble: %f", [myDoubleNumber doubleValue]);
 
    }

Output for this example code

2012-07-01 15:14:58.563 NSNumberSample[320:f803] myDoubleNumber: 3.14
2012-07-01 15:14:58.564 NSNumberSample[320:f803] myDouble: 3.140000

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsnumber.h/doublevalue.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz