Floating point handling #2
Notifications
Due Date
No due date set.
Blocks
#3 Make exec take arguments from console
laentropia/Calculator
#7 Do Further testing
laentropia/Calculator
Reference: laentropia/Calculator#2
Reference in New Issue
Block a user
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