What is the range of a double in Objective-C?

后端 未结 2 1764
盖世英雄少女心
盖世英雄少女心 2021-01-21 00:48

I have a program where I am calculating large distances. I then convert the distance (a double) using stringfromnumber to get the commas inserted (i.e. 1,234,567). This works

2条回答
  •  青春惊慌失措
    2021-01-21 01:00

    You can check you're own float.h for DBL_MAX to find out. I got a value of 1.797693e+308 from:

    #include 
    #include 
    
    int main ( void ) {
        printf("Max double %e \n", DBL_MAX);
        return 0;
    }
    

提交回复
热议问题