Open stokito opened 7 years ago
While I usually dislike inventing new syntax when a working one already exists, G makes me think "giga", not "big". I'd rather see \u1e04, capital B with dot below (think B decimal).
Nice idea. Lets think more. I have this thought that might be useful to get right decision:
B
personally I have first association like "Boolean" of "Binary" and even BTC (BitCoin) since I working a lot with financial systems. 0b
- is already used in Groovy as binary literalḄ
symbol usage? I mean does Ḅ
already used somewhere in context of big numbers?Big
class names BigDecimal
and BigInteger
. I think it's wrong to call something "big" or "short". For me correct name is something like Real as used in mathematics notation. But it's not real "Real" since only 10 based number which is bad for precision. G
literal is something strange counter intuitive and yes it has strict association with unit prefixes "giga".G
instead of B
? I found their discussion and in short "There is a potential conflict with Hexidecimal literals and the numeric suffixes B". So for some reason they decided to use G
(probably because biG). Also it was proposed to use M
prefix as in C# but was rejected since "doesn't seem intuitive for BigInteger".M
prefix for decimal
which mean like "Money". Actually decimal
is fixed size 128 bit so not exactly the same as BigDecimal
.N
prefix. In comments also was proposed T
as "Ten based number".So it becomes hard to choice literal. But actually should we? Literals are needed to make your life easier when you write a code. But in your plugin you need to show the code. So I would like to propose you just to show BidDecimal
and BigInteger
as usual number:
new BigDecimal("1.0005").add(new BigDecimal(42.42))
is shown as:
1.0005 + 42.42
What do you think about this?
The latest EAP build supports basic things like
new BigDecimal("1.0005").add(new BigDecimal(42.42))
More complicated case are to be supported later:
new BigDecimal("1.0005").add(new BigDecimal(42.42)).multiply(new BigDecimal(1.0))
Groovy has a cool feature that in my experience of development financial applications makes code more cleaner: decimal literal
G
forBigDecimal
. http://docs.groovy-lang.org/next/html/documentation/core-syntax.html#_decimal_literals Instead ofshow: