Python Forum
Why is 2/3 not just .666 repeating?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why is 2/3 not just .666 repeating?
#1
Hey I'm learning python now and was just learning formatting in my online class. When I ran the following code I got the following output. I thought 2/3 was always .666 repeating. Is this not the case? or can someone explain the output to me.

Code:
print("{0:1.54}".format(2/3))

Output:
0.66666666666666662965923251249478198587894439697265625
Reply


Messages In This Thread
Why is 2/3 not just .666 repeating? - by DocFro - Nov-25-2023, 10:09 PM
RE: Why is 2/3 not just .666 repeating? - by DocFro - Nov-26-2023, 12:59 AM
RE: Why is 2/3 not just .666 repeating? - by loben - Dec-12-2023, 08:48 AM
RE: Why is 2/3 not just .666 repeating? - by buran - Dec-12-2023, 09:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  repeating a user_input astral_travel 17 2,379 Oct-26-2022, 04:15 PM
Last Post: astral_travel
  if else repeating Frankduc 12 2,565 Jul-14-2022, 12:40 PM
Last Post: Frankduc
  matching a repeating string Skaperen 2 1,287 Jun-23-2022, 10:34 PM
Last Post: Skaperen
  Random Number Repeating Tzenesh 5 4,096 Jan-13-2021, 10:00 PM
Last Post: deanhystad
  factorial, repeating Aldiyar 4 2,847 Sep-01-2020, 05:22 PM
Last Post: DPaul
  number repeating twice in loop JonnyEnglish 3 3,338 Nov-24-2019, 09:23 AM
Last Post: ThomasL
  Repeating equations Tbot100 2 3,299 May-29-2019, 02:38 AM
Last Post: heiner55
  First non-repeating char and some errors. blackknite 1 2,305 Jan-06-2019, 02:19 PM
Last Post: stullis
  repeating for loop Kaldesyvon 5 3,882 Dec-06-2018, 08:00 PM
Last Post: ichabod801
  Repeating same number in sequence Rudinirudini 6 4,301 Oct-28-2018, 07:44 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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