Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
valid numbers
#1
is there anything (any string) that would be valid decimal.Decimal() but not valid float() and/or not valid int(,10)?  is there anything (any string) that would be valid float and/or valid int(,10) but not valid 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
#2
'NaN' is a valid decimal.Decimal() and a valid float(), but not a valid int(). Same with 'Infinity'.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Script getting reindexing only valid error cubangt 1 947 Dec-07-2023, 04:06 PM
Last Post: cubangt
Question Use function, retry until valid Ashcora 8 1,479 Jan-06-2023, 10:14 AM
Last Post: Ashcora
  checking for valid hexadecimal digits Skaperen 3 6,422 Sep-02-2021, 07:22 AM
Last Post: buran
  Limiting valid values for a variable in a class WJSwan 5 3,673 Jul-06-2020, 07:17 AM
Last Post: Gribouillis
  How to verify the give number is valid Mekala 3 2,414 May-16-2020, 02:40 PM
Last Post: anbu23
  C:\Windows\System32\appwiz.cpl is not a valid Win32 application Marceepoo 8 5,200 Mar-15-2020, 04:46 AM
Last Post: buran
  is a str object a valid iterator? Skaperen 6 5,667 Jan-27-2020, 08:44 PM
Last Post: Skaperen
  How to get valid error message while invoking REST API through Python gollupraveen 0 2,080 Oct-04-2019, 07:15 PM
Last Post: gollupraveen
  How to keep looping until the user input is valid ? KyawMyo 12 6,237 Jun-10-2019, 02:51 AM
Last Post: KyawMyo
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,757 May-09-2019, 12:19 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

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