Floating point handling #2
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
laentropia/Calculator#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What?
Right now the calculator can't handle any fractions or decimals, the plan is to implement it so that it can :).
How?
Well, there are two aproaches i want to have, first one would be to just allow floating pointers, we already have NODE_INTEGER for that so adding NODE_FLOATING or something like that and adding it to the union as well as adapting the lexer would be really easy. But, i want another approach too.
Instead of taking a floating point as literally that, we could have a Fraction type that stores the denominator and numerator, it would even have an algorithm for reducing itself for its minimal expression, handle 0 cases, could even extend to work as the division operator.
I would like to make the default to be use fractions instead of floating points so it will need to have the option to change that