final class BigDecimal extends AnyVal with Any.Datum.BigDecimal[Util.BigDecimal]

Big Decimal

BigDecimal is used for really large floating point calculations

// Calculate number Pi using Nilakantha series

2.0.Big
  .I.unfold(_.last + 4)
  .take(1000) // the more ther better
  .map(v => (4.0.Big / (v * (v + 1) * (v + 2)) - 4.0.Big / ((v + 2) * (v + 3) * (v + 4))))
  .fold(3.0.Big)(_ + _)
  .lp

// Prints: 3.1415926535585900763679167025419016466613791096007613231066955478
Ordering
  1. Alphabetic
Inherited
  1. BigDecimal
  2. Any.Datum.BigDecimal
  3. Custom.Number.Like
  4. Any.Datum.BigDecimal._use
  5. Any.Datum.BigDecimal._convert
  6. Any.Datum.Z.Number.Convert
  7. Any.Datum.BigDecimal._compare
  8. Any.Datum.Z.Number.Compare
  9. scala.math.Ordered
  10. java.lang.Comparable
  11. Any.Datum.Comparable
  12. Any.Datum.Ref
  13. Any.Datum
  14. Any.Wrap
  15. scala.AnyVal
  16. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Constructor

  1. new BigDecimal(real: java.math.BigDecimal)
    Definition Classes
    BigDecimal

Constant

  1. val real: java.math.BigDecimal
    Definition Classes
    BigDecimal_convert_Trait

Method

  1. def abs: BigDecimal
    Definition Classes
    _use
  2. def apply(v: Percent): BigDecimal
    Definition Classes
    _use
  3. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  4. def compare(v: BigDecimal): Int
    Definition Classes
    _compare → Ordered
  5. def compareTo(that: BigDecimal): Int
    Definition Classes
    Ordered → Comparable
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. def make(v: java.math.BigDecimal): BigDecimal
    Attributes
    protected
    Definition Classes
    _Trait_Trait
  8. def max(v: BigDecimal): BigDecimal
    Definition Classes
    _compare
  9. def min(v: BigDecimal): BigDecimal
    Definition Classes
    _compare
  10. def realNumber: java.math.BigDecimal
    Attributes
    protected
    Definition Classes
    _TraitLike
  11. def round(scale: Int, r: Custom.Rounding = \/): BigDecimal

    Round value

    Round value

    Negative scale specifies number of rounding digits before the period

    Positive scale specifies number of rounding digits after the period

    Note. Positive scale does not make sense if this is integral value

    By default the rounding is done "half up'

    Definition Classes
    _use
  12. def setup: BigDecimal.type
    Attributes
    protected
    Definition Classes
    BigDecimal_Trait_Trait_Trait
  13. def signum: Int

    Sign function

    Sign function

    Returns -1 if this < 0

    Returns 0 if this == 0

    Returns 1 if this > 0 *

    Definition Classes
    _use
  14. def toBigInteger: Util.BigInteger
    Definition Classes
    _convert
  15. def toByte: Byte

    Convert to Byte

    Convert to Byte

    Returns the value of this as Byte

    Definition Classes
    _convert → Convert
  16. def toDouble: Double

    Convert to Double

    Convert to Double

    Returns the value of this as Double

    Definition Classes
    _convert → Convert
  17. def toFloat: Float
    Definition Classes
    _convert → Convert
  18. def toInt: Int

    Convert to Int

    Convert to Int

    Returns the value of this as Int

    Definition Classes
    _convert → Convert
  19. def toLong: Long

    Convert to Long

    Convert to Long

    Returns the value of this as Long

    Definition Classes
    _convert → Convert
  20. def toNumber: java.math.BigDecimal

    Convert to Number

    Convert to Number

    Returns the value of this as java.lang.Number

    Definition Classes
    _convert → Convert
  21. def toShort: Short

    Convert to Short

    Convert to Short

    Returns the value of this as Short

    Definition Classes
    _convert → Convert
  22. def toString(): String
    Definition Classes
    BigDecimal → Any

Operator

  1. def unary_-: BigDecimal

    Negate

    Negate

    Returns a new value, which is negated this

    Definition Classes
    _use
  2. def !=(v: Double): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  3. def !=(v: Float): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  4. def !=(v: Long): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  5. def !=(v: Int): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  6. def !=(v: Short): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  7. def !=(v: Byte): Boolean

    Not equals test

    Not equals test

    Returns true if this is not equal to v, false otherwise

    Definition Classes
    _compare → Compare
  8. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  9. final def ##(): Int
    Definition Classes
    Any
  10. def %(v: Long): BigDecimal
    Definition Classes
    _use
  11. def %(v: Double): BigDecimal
    Definition Classes
    _use
  12. def %(v: BigDecimal): BigDecimal

    Remainder

    Remainder

    Returns a new value, which is remainder of this divided by v

    Definition Classes
    _use
  13. def %@(v: Long): Percent
    Definition Classes
    _use
  14. def %@(v: Double): Percent

    Percent At

    Percent At

    Returns percentage of this compared to v

    Definition Classes
    _use
  15. def %@(v: BigDecimal): Percent

    Percent At

    Percent At

    Returns percentage of this compared to v

    Definition Classes
    _use
  16. def *(v: Long): BigDecimal
    Definition Classes
    _use
  17. def *(v: Double): BigDecimal
    Definition Classes
    _use
  18. def *(v: BigDecimal): BigDecimal

    Multiply by

    Multiply by

    Returns a new value, which is this value multiplied by v

    Definition Classes
    _use
  19. def +(v: Percent, V: \/ = \/): BigDecimal
    Definition Classes
    _use
  20. def +(v: Long): BigDecimal
    Definition Classes
    _use
  21. def +(v: Double): BigDecimal
    Definition Classes
    _use
  22. def +(v: BigDecimal): BigDecimal
    Definition Classes
    _use
  23. def -(v: Percent, V: \/ = \/): BigDecimal
    Definition Classes
    _use
  24. def -(v: Long): BigDecimal
    Definition Classes
    _use
  25. def -(v: Double): BigDecimal
    Definition Classes
    _use
  26. def -(v: BigDecimal): BigDecimal
    Definition Classes
    _use
  27. def /(v: Long): BigDecimal
    Definition Classes
    _use
  28. def /(v: Double): BigDecimal
    Definition Classes
    _use
  29. def /(v: BigDecimal)(implicit r: Custom.Rounding = \/, s: Custom.Number.Scale = DEFAULT): BigDecimal

    Divide by

    Divide by

    Returns a new value, which is this value divided by v

    Definition Classes
    _use
  30. def <(v: Double): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  31. def <(v: Float): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  32. def <(v: Long): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  33. def <(v: Int): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  34. def <(v: Short): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  35. def <(v: Byte): Boolean

    Is less test

    Is less test

    Returns true if this is less than v, false otherwise

    Definition Classes
    _compare → Compare
  36. def <(that: BigDecimal): Boolean
    Definition Classes
    Ordered
  37. def <=(v: Double): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  38. def <=(v: Float): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  39. def <=(v: Long): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  40. def <=(v: Int): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  41. def <=(v: Short): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  42. def <=(v: Byte): Boolean

    Is less or equal test

    Is less or equal test

    Returns true if this is less or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  43. def <=(that: BigDecimal): Boolean
    Definition Classes
    Ordered
  44. def ==(v: Double): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  45. def ==(v: Float): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  46. def ==(v: Long): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  47. def ==(v: Int): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  48. def ==(v: Short): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  49. def ==(v: Byte): Boolean

    Equals test

    Equals test

    Returns true if this is equal to v, false otherwise

    Definition Classes
    _compare → Compare
  50. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  51. def >(v: Double): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  52. def >(v: Float): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  53. def >(v: Long): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  54. def >(v: Int): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  55. def >(v: Short): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  56. def >(v: Byte): Boolean

    Is greater test

    Is greater test

    Returns true if this is greater than v, false otherwise

    Definition Classes
    _compare → Compare
  57. def >(that: BigDecimal): Boolean
    Definition Classes
    Ordered
  58. def >=(v: Double): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  59. def >=(v: Float): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  60. def >=(v: Long): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  61. def >=(v: Int): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  62. def >=(v: Short): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  63. def >=(v: Byte): Boolean

    Is greater or equal test

    Is greater or equal test

    Returns true if this is greater or equal to v, false otherwise

    Definition Classes
    _compare → Compare
  64. def >=(that: BigDecimal): Boolean
    Definition Classes
    Ordered