fork download
  1. #include <string>
  2. using namespace std;
  3. double _string_to_double(string &s,unsigned short radix){
  4. double n = 0, y = 1;
  5. for (unsigned short x = s.size();x&&s[--x]^'-';)
  6. if(s[x] ^ '.')
  7. n+=( (s[x] - (s[x]<='9' ? '0':'0'+7) ) * y ), y*=radix;
  8. else
  9. n/=y, y = 1;
  10. return s[0] ^ '-' ? n:n*-1;
  11. }
  12.  
  13. int main (){
  14.  
  15. string a = "184414124";
  16. for(unsigned long long x = 1000000;x>0;--x){
  17. _string_to_double(a,10);
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0.09s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty