strtod函数
来源:互联网 发布:普通话发音矫正软件 编辑:程序博客网 时间:2024/06/03 14:34
/****strtod.c - convert string to floating point number** Copyright (c) Microsoft Corporation. All rights reserved.**Purpose:* Convert character string to floating point number********************************************************************************/#include <cruntime.h>#include <stdlib.h>#include <fltintrn.h>#include <string.h>#include <ctype.h>#include <mbctype.h>#include <errno.h>#include <math.h>#include <internal.h>#include <locale.h>#include <mtdll.h>#include <setlocal.h>/****double strtod(nptr, endptr) - convert string to double**Purpose:* strtod recognizes an optional string of tabs and spaces,* then an optional sign, then a string of digits optionally* containing a decimal point, then an optional e or E followed* by an optionally signed integer, and converts all this to* to a floating point number. The first unrecognized* character ends the string, and is pointed to by endptr.**Entry:* nptr - pointer to string to convert**Exit:* returns value of character string* char **endptr - if not NULL, points to character which stopped* the scan**Exceptions:* Input parameters are validated. Refer to the validation section of the function.********************************************************************************/extern "C" double __cdecl _strtod_l ( const char *nptr, REG2 char **endptr, _locale_t plocinfo ){ struct _flt answerstruct; FLT answer; double tmp; unsigned int flags; REG1 char *ptr = (char *) nptr; _LocaleUpdate _loc_update(plocinfo); /* validation section */ if (endptr != NULL) { /* store beginning of string in endptr */ *endptr = (char *)nptr; } _VALIDATE_RETURN(nptr != NULL, EINVAL, 0.0); /* scan past leading space/tab characters */ while ( _isspace_l((int)(unsigned char)*ptr, _loc_update.GetLocaleT()) ) ptr++; /* let _fltin routine do the rest of the work */ /* ok to take address of stack variable here; fltin2 knows to use ss */ answer = _fltin2( &answerstruct, ptr, _loc_update.GetLocaleT()); if ( endptr != NULL ) *endptr = (char *) ptr + answer->nbytes; flags = answer->flags; if ( flags & (512 | 64)) { /* no digits found or invalid format: ANSI says return 0.0, and *endptr = nptr */ tmp = 0.0; if ( endptr != NULL ) *endptr = (char *) nptr; } else if ( flags & (128 | 1) ) { if ( *ptr == '-' ) tmp = -HUGE_VAL; /* negative overflow */ else tmp = HUGE_VAL; /* positive overflow */ errno = ERANGE; } else if ( (flags & 256) && answer->dval == 0.0 ) { tmp = 0.0; /* underflow (denormals OK) */ errno = ERANGE; } else tmp = answer->dval; return(tmp);}extern "C" double __cdecl strtod ( const char *nptr, REG2 char **endptr ){ return _strtod_l(nptr, endptr, NULL);}
- strtod() 函数
- strtod函数
- strtod函数
- strtod()函数
- strtod-strtod, 字符串 转 数字 函数
- strtod函数的使用
- C语言strtod函数DEMO
- strtod()
- strtod
- strtol函数、strtod函数、strtoul函数
- 字符串转换为double的函数strtod
- 数据类型转换函数strtod | atoi | atol
- 函数atof,atoi,atol,strtod,strtol,strtoul
- atoi,itoi,atol,strtol, strtod函数转换
- strtod字符串转换函数应用实例
- 函数atof,atoi,atol,strtod,strtol,strtoul
- VC atoi,atol,strtod,strtol,strtoul函数介绍
- 6.atoi,atol,strtod,strtol,strtoul函数介绍
- ECSHOP数据字典
- uva Power of Cryptography
- LeetCode: Decode Ways
- Jquery选中radio
- 配置android开发环境eclipse获取ADT获取不到 https://dl-ssl.google.com/android/eclipse
- strtod函数
- uva 575 Skew Binary
- 节日颓废抱怨
- C#泛型集合 using System.Collections.Generic
- SRM 531 div1 600/300 div2 950
- hdu 1253 胜利大逃亡 简单三维BFS
- 获取本机IP地址
- JAVA面向对象笔记(上)
- jQuery选择器大全