Packages

c

spinal.core

PhysicalNumber

abstract class PhysicalNumber[T <: PhysicalNumber[_]] extends Formattable

Base class for the Physical representation (Hertz, Time, ...)

When formatting (e.g. via f-interpolation) one can use: - precision to specify precsion (e.g. "%.3f" for three digits past comma) - width to pad with space to a specified length (e.g. "%5f" to get at least 5 characters) - left justified padding (e.g. "%-5f" to pad right to 5 characters) - alternate to print w/o unit (e.g. "%#f")

Linear Supertypes
Formattable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PhysicalNumber
  2. Formattable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PhysicalNumber(value: BigDecimal)

Abstract Value Members

  1. abstract def decompose: (BigDecimal, String)
  2. abstract def newInstance(value: BigDecimal): T

Concrete Value Members

  1. def %(that: BigDecimal): T
  2. def %(that: PhysicalNumber[_]): BigDecimal
  3. def *(that: BigDecimal): T
  4. def *(that: PhysicalNumber[_]): BigDecimal
  5. def +(that: BigDecimal): T
  6. def +(that: T): T
  7. def -(that: BigDecimal): T
  8. def -(that: T): T
  9. def /(that: BigDecimal): T
  10. def /(that: PhysicalNumber[_]): BigDecimal
  11. def <(that: T): Boolean
  12. def <=(that: T): Boolean
  13. def >(that: T): Boolean
  14. def >=(that: T): Boolean
  15. def abs: T
  16. def decomposeString: String
  17. def formatTo(formatter: Formatter, flags: Int, width: Int, precision: Int): Unit
    Definition Classes
    PhysicalNumber → Formattable
  18. def max(that: T): T
  19. def min(that: T): T
  20. def toBigDecimal: BigDecimal
  21. def toDouble: Double
  22. def toInt: Int
  23. def toLong: Long