I am a fairly new to Arduino, So I apologize if this is a dumb question.
Anyway, perhaps this is a limitation of programming, but printing pi using the variable pi and Arduino's PI with the following code:
float pi=3.141592653589;
void setup() {
Serial.begin(9600);
Serial.println(pi,10);
Serial.println(PI,10);
}
void loop() {}
yields both:
3.1415927410
3.1415927410
on the serial monitor.
These are obviously wrong after some digits. Is this just the serial monitor? Or is it wrong also when I do calculations with it? (I need very high precision calculations). I don't care about printing the result of my calculations, but I do need it to be as accurate as possible.
Thanks a bunch.