Python Forum
float multiplication - unexpected output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
float multiplication - unexpected output
#1
Hello,

I have a unexpected output on a simple multiplication:
0.55*50000
Output:
27500.000000000004
While if I run an equivalent expression
0.55*5*10000
Output:
27500.0
Which is the right output. Is is also the case for other expressions like : 0.55*100 that gives: 55.00000000000001
Anybody knows what this is due to ?

Many thanks,

Inès
Reply


Messages In This Thread
float multiplication - unexpected output - by inesk - Dec-11-2018, 10:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output Starter 2 439 Nov-22-2023, 12:08 AM
Last Post: Starter
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 657 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  Unexpected output while using random.randint with def terickson2367 1 469 Oct-24-2023, 05:56 AM
Last Post: buran
  Formatting float number output barryjo 2 879 May-04-2023, 02:04 PM
Last Post: barryjo
  Unexpected output from df.loc when indexing by label idratherbecoding 6 1,127 Apr-19-2023, 12:11 AM
Last Post: deanhystad
  Multiplication Table code alexsendlegames100 3 1,317 Jun-06-2022, 09:45 AM
Last Post: Gribouillis
  Try to solve GTG multiplication table problem. Frankduc 6 1,937 Jan-18-2022, 08:26 PM
Last Post: Frankduc
  Need help with my Python code (Multiplication) NeedHelpPython 2 1,635 Oct-04-2021, 12:09 PM
Last Post: Pedroski55
  unexpected output asyrafcc99 0 1,479 Oct-24-2020, 02:40 PM
Last Post: asyrafcc99
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,012 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020