Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Decimal floating point by default (instead of binary floating point) #3

@dumblob

Description

@dumblob

C23 (implementations of proposals finished in 2021 and formally adopted in 2022 as planned) will natively support _Decimal32 _Decimal64 and _Decimal128.

This is one of the biggest changes C had since C99. Presumably it'll create an enormous pressure on all other languages to support decimal floating point as basic number type.

Til could reconsider whether making all float literals (and all floating point arithmetics) a decimal floating point number wouldn't be the easier way to go. Otherwise if it won't be part of Til at that time, Til will have a hard time to catch up unless breaking backwards compatibility will not be an issue. Such a change takes years which is really no good for a new language.

I'd recommend using mpdecimal library (CPython uses it as well) if decimal floats shall become part of Til.

Note also I personally don't think there is any need for making floats BigDecimal by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions