Changeset 1869


Ignore:
Timestamp:
Mar 14, 2005, 5:47:39 AM (20 years ago)
Author:
bird
Message:

Initial coding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/testcase/libc/miscinnotek/strtof-1.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1868 r1869  
    11#include <stdio.h>
     2#include <stdlib.h>
     3#include <math.h>
     4#include <float.h>
    25
    36int main(void)
    47{
    5     float th;
    6     //sscanf("-30", "%f", &th);
    78    char *pszEnd = NULL;
    8     th = strtof("-30", &pszEnd);
    9     printf("%f\n", th);
     9    float th = strtof("-30", &pszEnd);
     10    if (th != -30.0)
     11    {
     12        printf("strtof-1: FAILURE (strtof -> %f)\n", th);
     13        return 1;
     14    }
    1015
     16    th = 0.0;
     17    sscanf("-30", "%f", &th);
     18    if (th != -30.0)
     19    {
     20        printf("strtof-1: FAILURE (sscanf -> %f)\n", th);
     21        return 1;
     22    }
     23
     24    printf("strtof-1: SUCCESS\n");
    1125    return 0;
    1226}
Note: See TracChangeset for help on using the changeset viewer.