Skip to content

Allow fractions, complex numbers, NaN for a Quantity's number #36

@matterhorn103

Description

@matterhorn103
  • NaN is already permitted as it is part of Decimal just like inf and -0, but important to check that Quantity's methods don't run into issues due to assuming that number will always be real
  • Keep complex or Fraction when used to create a Quantity
  • Account for different behaviour of those types in methods of Quantity (and of Unit) i.e. that not everything works with all types
  • Methods that only make sense with decimal quantities should just fail with complex/Fraction and the onus is placed on the user
  • Detect strings "1+2j" "1/2" as being complex and fractional respectively and pass them to complex() or Fraction() as appropriate

Metadata

Metadata

Assignees

No one assigned

    Labels

    considerSomething to think aboutenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions