libcfe  0.12.1
some useful C-functions
char_to_double.c File Reference
#include "config.h"
#include "char_to_double.h"
#include <string.h>
#include <math.h>
#include "len.h"
#include "char_to_int.h"
Include dependency graph for char_to_double.c:

Go to the source code of this file.

Macros

#define MIN(a, b)   (a > b ? b : a)
 

Functions

short int check_double (const char *s, int len)
 
long double char_to_double (const char *s, int len)
 

Macro Definition Documentation

◆ MIN

#define MIN (   a,
 
)    (a > b ? b : a)

Definition at line 11 of file char_to_double.c.

Function Documentation

◆ char_to_double()

long double char_to_double ( const char *  s,
int  len 
)

Return the decimal number this string represents.

Parameters
[in]sThe string that contains the number.
[in]lenThe length of the string that s points to. If -1 is given the length is auto determined and a null terminated string is assumed.
Returns
The number that 's' represents.

Definition at line 38 of file char_to_double.c.

Here is the call graph for this function:

◆ check_double()

short int check_double ( const char *  s,
int  len 
)

Check if the string represents a decimal value.

Parameters
[in]sThe string that contains the number.
[in]lenThe length of the string that s points to. If -1 is given the length is auto determined and a null terminated string is assumed.
Returns
result:
  • 0 false, not a number
  • 1 true, this contains a number

Definition at line 14 of file char_to_double.c.