Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Decimal problem
#3
You could format the numbers for better output:

#python3
c = 15.000000000000002-8.881784197001252e-16j

print(c)
print("{0:.16f}".format(c))

==>
(15.000000000000002-8.881784197001252e-16j)
15.0000000000000018-0.0000000000000009j
Reply


Messages In This Thread
Decimal problem - by hmillsar - Dec-01-2016, 05:40 PM
RE: Decimal problem - by ichabod801 - Dec-01-2016, 09:49 PM
RE: Decimal problem - by heiner55 - Dec-02-2016, 06:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  int() problem when extracting part of decimal perseus142 4 2,502 Mar-23-2020, 06:24 PM
Last Post: perseus142
  testing for Decimal w/o importing decimal every time Skaperen 7 4,507 May-06-2019, 10:23 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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