Working with large floating point numbers.
Posted: Tue Mar 14, 2023 11:50 pm
Hello there,
I'm struggling with calculations involving large floats. Running the following code on my Wemos Lolin32 Lite on Arduino featuring an ESP-32 Rev1
leading to the following output after some time:
4115135655.09 is way below theoretical limits of float (3e38) let alone double (1e308). What's happening here? I know Esp32 is not the best number for fast or precise FLOPs, but something else but precision seems to be wrong here.
I would be glad if someone could reproduce this / help me / hint me at other resources, thanks in advance!
I'm struggling with calculations involving large floats. Running the following code on my Wemos Lolin32 Lite on Arduino featuring an ESP-32 Rev1
- double test = 2.;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(31250);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- test*=1.1;
- Serial.println(test);
- }
Code: Select all
3400938557.93
3741032413.72
4115135655.09
ovf
ovf
ovf
I would be glad if someone could reproduce this / help me / hint me at other resources, thanks in advance!