spire icon indicating copy to clipboard operation
spire copied to clipboard

big prefix

Open benibela opened this issue 12 years ago • 2 comments

scala> big"100" res168: scala.math.BigInt = 100

scala> big"1000" error: exception during macro expansion: java.lang.NumberFormatException: illegal SI BigInt constant at spire.macrosk.Macros$.handleBigInt(Macros.scala:186) at spire.macrosk.Macros$.siBigInt(Macros.scala:205)

scala> BigInt("1000") res170: scala.math.BigInt = 1000

benibela avatar Apr 13 '13 12:04 benibela

Maybe the error message should be better. The 'big' macro wants you to use SI spaces every three digits, e.g.:

big"1 123 345"

Maybe we need a simpler macro that just creates BigInt literals?

non avatar Apr 13 '13 16:04 non

The 'big' macro wants you to use SI spaces every three digits, e.g.: It does? Why?

Perhaps it should just accept both (w+w/o spaces)

On 04/13/2013 06:02 PM, Erik Osheim wrote:

Maybe the error message should be better. The 'big' macro wants you to use SI spaces every three digits, e.g.:

big"1 123 345"

Maybe we need a simpler macro that just creates BigInt literals?

— Reply to this email directly or view it on GitHub https://github.com/non/spire/issues/92#issuecomment-16335623.

benibela avatar Apr 13 '13 22:04 benibela