Skip to content

Add a floating point type perhaps? (Ducks and runs away) #1272

@binarykitchen

Description

@binarykitchen

Hi everyone,

(Awesome library and plenty of pretty unicorns)

There is one TypeScript ... no, more a famous JavaScript/Computer Science related problem haunting me. This classic Binary Representation of Decimals Oracle raised in 1991: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

We have the type number which can be any number from floats, doubles to integers whatever. I wonder if it's possible to differentiate them within TypeScript? I've run searches and this question hasn't been raised before so I'll give it a try here ...

Because I'm implementing an app doing microtransactions. Picked the mathjs library, which helps. Although I'm still worried about misleading types when it comes to numbers. I don't want to add additional checks in every function whether that number has floating points or not

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions