root/src/stof.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. stof

   1 /* ---------------------------------------------------------------- */
   2 /* ---------------------------------------------------------------- */
   3 
   4 #include <unistd.h>
   5 #include <stdio.h>
   6 #include <math.h>
   7 #include <stdlib.h>
   8 #include <pthread.h>
   9 #include "CalculiX.h"
  10 
  11 #include "readfrd.h"
  12 
  13 
  14 /* liefert double aus string von position a bis b */
  15 double stof(char *string, ITG a, ITG b)
  16 {
  17   register ITG    n, i;
  18   static char  puffer[MAX_LINE_LENGTH];
  19 
  20   n=-1;
  21   for (i=a-1; i<b; i++)
  22     {
  23     n++;
  24     if ((i>=MAX_LINE_LENGTH)||(n>=MAX_LINE_LENGTH)) break;
  25     puffer[n] = string[i];
  26   }
  27   puffer[n+1] = '\0';
  28   return( atof( puffer ) );
  29 }
  30 

/* [<][>][^][v][top][bottom][index][help] */