Custom number type
Chlumsky opened this issue · 0 comments
Chlumsky commented
Add the possibility to define custom number types (integer or real), e.g. a dynamic-sized "big integer" type. The parser API could look like this:
clear- sets$Sto zeroappendDigit- appends (decimal) digit$Xto the whole part ot$S- equivalent to10*$S+$X, $E isVALUE_OUT_OF_RANGEerror statementappendFractionalDigit- appends$I-th (decimal) fractional digit$Xto$S, if left blank, the type is assumed to be integer-onlysetExponent- multiplies$Sby 10 to the power of$XmakeNegative- changes the value to negative, guaranteed to be called at the end
Or, instead of the last two, there could be finalize with arguments for sign and exponent.