HNHacker News
TopNewBestAskShowJobs

sadiuasdi67f678

8 karma · joined March 4, 2018

submissionscomments
sadiuasdi67f678··on DEC64: Decimal Floating Point
I'm not talking about money, I am talking about the decimal data type, as is OP.

https://en.wikipedia.org/wiki/Decimal_data_type

Also, I don't try to endorse the Python API. I don't even use it. I just pointed out their api is easier since the operators work with their decimal data type, as opposed to the Java version.

sadiuasdi67f678··on DEC64: Decimal Floating Point
In Java, the java.math.BigDecimal is not a primitive data type. It also has an awkward api due to lack of operator overloading (thanks to BigDecimal not being a primitive data type it seems).

In Python, the story looks slightly better:

    from decimal import *
    >>> getcontext().prec = 6
    >>> Decimal(1) / Decimal(7)
    Decimal('0.142857')
But neither of these data types is even close to being a first class citizen in either language.