Nrf52840 float precision is not enough

I need to be accurate to five decimal places.

Use nrf52840 and ses.

Test code:

void double_test()
{
  double d;
  char mm[]="42.4158";
  d=atof(mm)/60.0+22;
  gps_location.la = d;
}
 

Execute d=atof(mm)/60.0 result 0.70693.It's right.

But execute  d = 0.70693+22 result 22.7069.It is missing a decimal place.

I need to be accurate to five decimal places.So what should I do?

Parents Reply Children
Related