Changeset 7f9df7b9 in mainline for uspace/lib/posix/src/stdlib/strtold.c
- Timestamp:
- 2018-01-22T22:42:57Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a08c70
- Parents:
- e0f47f5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/stdlib/strtold.c
re0f47f5 r7f9df7b9 32 32 /** @file Backend for floating point conversions. 33 33 */ 34 35 #define LIBPOSIX_INTERNAL36 #define __POSIX_DEF__(x) posix_##x37 34 38 35 #include "../internal/common.h" … … 407 404 * @return An approximate representation of the input floating-point number. 408 405 */ 409 long double posix_strtold(const char *restrict nptr, char **restrict endptr)406 long double strtold(const char *restrict nptr, char **restrict endptr) 410 407 { 411 408 assert(nptr != NULL); … … 433 430 434 431 /* check for NaN */ 435 if ( posix_strncasecmp(&nptr[i], "nan", 3) == 0) {432 if (strncasecmp(&nptr[i], "nan", 3) == 0) { 436 433 // FIXME: return NaN 437 434 // TODO: handle the parenthesised case … … 445 442 446 443 /* check for Infinity */ 447 if ( posix_strncasecmp(&nptr[i], "inf", 3) == 0) {444 if (strncasecmp(&nptr[i], "inf", 3) == 0) { 448 445 i += 3; 449 if ( posix_strncasecmp(&nptr[i], "inity", 5) == 0) {446 if (strncasecmp(&nptr[i], "inity", 5) == 0) { 450 447 i += 5; 451 448 }
Note:
See TracChangeset
for help on using the changeset viewer.