Python Forum
unexpected decimal.InvalidOperation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unexpected decimal.InvalidOperation
#1
when doing decimal.Decimal('-inf')+decimal.Decimal('+inf') i got decimal.InvalidOperation raised. i was expecting to get Decimal('0'). there are a few operations on infinity that normal arithmetic allows such as inf-inf -> 0 and 0*inf -> 0 both of which the decimal.Decimal class does not allow. is there a reason for this or is it just up to whoever implemented decimal.Decimal?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
unexpected decimal.InvalidOperation - by Skaperen - Dec-25-2021, 02:35 AM
RE: unexpected decimal.InvalidOperation - by casevh - Dec-25-2021, 07:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  number of digits in a decimal.Decimal number object Skaperen 0 822 Aug-26-2023, 07:38 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