Python Forum
math.sqrt / pow() rounding small floats, workaround?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
math.sqrt / pow() rounding small floats, workaround?
#8
Grr. I can't believe how much I've forgotten in only ~ 2 months of not writing in Python. I should have known this haha.

Also, had no idea that:
print("""\ x """)
was even a thing that I could do. That's awesome, much more efficient.

Thanks for the revision! I see you not only solved my problem, but also corrected my habit of "if, if, if, if-ing" and not to mention, you boxed all of it for me!

Thanks for all the things! haha. Saved me like 2 hours of trial-error and you even got my while not programIsTerminated to work. I basically just gave up on that haha.

Thanks again, you'll likely see more of me around here!
Reply


Messages In This Thread
RE: math.sqrt / pow() rounding small floats, workaround? - by robertHTompkins - Dec-22-2018, 10:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  When is it safe to compare (==) two floats? Radical 4 818 Nov-12-2023, 11:53 AM
Last Post: PyDan
  need help rounding joseph202020 7 1,407 Feb-21-2023, 08:13 PM
Last Post: joseph202020
  from numpy array to csv - rounding SchroedingersLion 6 2,301 Nov-14-2022, 09:09 PM
Last Post: deanhystad
  math.log versus math.log10 stevendaprano 10 2,511 May-23-2022, 08:59 PM
Last Post: jefsummers
  floats 2 decimals rwahdan 3 1,677 Dec-19-2021, 10:30 PM
Last Post: snippsat
  Random data generation sum to 1 by rounding juniorcoder 9 3,574 Oct-20-2021, 03:36 PM
Last Post: deanhystad
  Rounding issue kmll 1 1,451 Oct-08-2021, 10:35 AM
Last Post: Yoriz
  Not rounding to desired decimal places? pprod 2 2,611 Mar-05-2021, 11:11 AM
Last Post: pprod
  Why getting ValueError : Math domain error in trig. function, math.asin() ? jahuja73 3 3,846 Feb-24-2021, 05:09 PM
Last Post: bowlofred
  Decimal Rounding error project_science 4 2,805 Jan-06-2021, 03:14 PM
Last Post: project_science

Forum Jump:

User Panel Messages

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