Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 9202

Python • Python Floating point addtion question

$
0
0
I feel stupid asking this but I am going crazy. I am not a Pythom guru :)
I am not getting what I expect for the following, i would expect 2451545.234567

Code:

float_test = 2451545.0 + 0.234567print(f"test {float_test:.6f}") 
The result show:
float_test 2451545.000000

if i make the 2451545.0 smaller, then numbers show after the decimal point but are incorrect.

Plz help

tnx

Statistics: Posted by Cragjock — Thu Aug 21, 2025 6:29 pm



Viewing all articles
Browse latest Browse all 9202

Trending Articles