user66517: Im having some problems with parsing gps coordinates with the arduino ide.
To be honest I want to process the data without a library. 
From my sensor I get this String: 4815.98450
The result of String.toDouble(): 4815.9843750
I also parsed it on my own, but i got the same result: (yes this code is not nice ;))
char buf[10];
  msg.toCharArray(buf, 19);
  double num = 0.0;

  int c;

  c = buf[0] - '0';
  double num0 = (c * 1000);
  c = buf[1] - '0';
  double num1 = (c * 100);
  c = buf[2] - '0';
  double num2 = (c * 10);
  c = buf[3] - '0';
  double num3 = (c * 1);
  c = buf[5] - '0';
  double num5 = (c * 0.1);
  c = buf[6] - '0';
  double num6 = (c * 0.01);
  c = buf[7] - '0';
  double num7 = (c * 0.001);
  c = buf[8] - '0';
  double num8 = (c * 0.0001);
  c = buf[9] - '0';
  double num9 = (c * 0.00001);
  num = num + num0;
  num = num + num1;
  num = num + num2;
  num = num + num3;
  num = num + num5;
  num = num + num6;
  num = num + num7;
  num = num + num8;
  num = num + num9;

Does somebody have a solution for my problems? 
Thank you very much :=)

user16780: double (or float) is just an inappropriate data type. 
Perhaps you take int(4815) and float(0.98450) as two numbers? 

And BTW, I bet from your sensor you don't get a String object. 

user7508: There is no easy solution. The Arduino you are using does not support
double precision floating point. The type double is just an alias for
float, which has 24-bit accuracy.
Your program is actually giving you the correct result, as the float
closest to 4815.98450 is exactly 4815.984375.

66517: <p>Im having some problems with parsing gps coordinates with the arduino ide.</p>

<p>To be honest I want to process the data without a library. </p>

<p>From my sensor I get this String: 4815.98450</p>

<p>The result of String.toDouble(): 4815.9843750</p>

<p>I also parsed it on my own, but i got the same result: (yes this code is not nice ;))</p>

<pre><code>char buf[10];
  msg.toCharArray(buf, 19);
  double num = 0.0;

  int c;

  c = buf[0] - '0';
  double num0 = (c * 1000);
  c = buf[1] - '0';
  double num1 = (c * 100);
  c = buf[2] - '0';
  double num2 = (c * 10);
  c = buf[3] - '0';
  double num3 = (c * 1);
  c = buf[5] - '0';
  double num5 = (c * 0.1);
  c = buf[6] - '0';
  double num6 = (c * 0.01);
  c = buf[7] - '0';
  double num7 = (c * 0.001);
  c = buf[8] - '0';
  double num8 = (c * 0.0001);
  c = buf[9] - '0';
  double num9 = (c * 0.00001);
  num = num + num0;
  num = num + num1;
  num = num + num2;
  num = num + num3;
  num = num + num5;
  num = num + num6;
  num = num + num7;
  num = num + num8;
  num = num + num9;
</code></pre>

<p>Does somebody have a solution for my problems? </p>

<p>Thank you very much :=)</p>
 16780: <p><code>double</code> (or float) is just an inappropriate data type. </p>

<p>Perhaps you take int(4815) and float(0.98450) as two numbers? </p>

<hr>

<p>And BTW, I bet from your sensor you don't get a String object. </p>
 7508: <p>There is no easy solution. The Arduino you are using does not support
double precision floating point. The type <code>double</code> is just an alias for
<code>float</code>, which has 24-bit accuracy.</p>

<p>Your program is actually giving you the correct result, as the float
closest to 4815.98450 is exactly 4815.984375.</p>
