summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'chiselFrontend/src/main')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Bits.scala4
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Num.scala2
2 files changed, 3 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/Bits.scala b/chiselFrontend/src/main/scala/chisel3/Bits.scala
index 633636fd..57ce98d2 100644
--- a/chiselFrontend/src/main/scala/chisel3/Bits.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Bits.scala
@@ -1186,7 +1186,7 @@ package experimental {
def binaryPoint: BinaryPoint
/** Return the [[Double]] value of this instance if it is a Literal
- * @note this method may return throw an exception if the literal value won't fit in a Double
+ * @note this method may throw an exception if the literal value won't fit in a Double
*/
def litToDoubleOption: Option[Double] = {
litOption match {
@@ -1201,7 +1201,7 @@ package experimental {
def litToDouble: Double = litToDoubleOption.get
/** Return the [[BigDecimal]] value of this instance if it is a Literal
- * @note this method may return throw an exception if the literal value won't fit in a BigDecimal
+ * @note this method may throw an exception if the literal value won't fit in a BigDecimal
*/
def litToBigDecimalOption: Option[BigDecimal] = {
litOption match {
diff --git a/chiselFrontend/src/main/scala/chisel3/Num.scala b/chiselFrontend/src/main/scala/chisel3/Num.scala
index e4d61d94..7a6b0744 100644
--- a/chiselFrontend/src/main/scala/chisel3/Num.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Num.scala
@@ -282,7 +282,7 @@ trait NumObject {
* @return
*/
def toBigDecimal(value: BigInt, binaryPoint: Int): BigDecimal = {
- if(value.bitLength > 108) {
+ if(value.bitLength > MaxBitsBigIntToBigDecimal) {
throw new ChiselException(
s"BigInt $value with bitlength ${value.bitLength} is too big, precision lost with > $MaxBitsBigIntToBigDecimal bits"
)