[Oberon] System-V - Float to Alpha
Jörg
joerg.straube at iaeth.ch
Mon Feb 4 15:19:06 CET 2019
With a little heuristic you might adopt WriteRealFix that outputs 123.123 instead of 1.23123E+02 (
If you only implemented binary minus [ Swap(), Push(Pop() - Pop()) ] you indeed have to do "0" "x" "-"
Unary minus (called "CHS" or "+/-" on HP calculators) is an own operator Push(-Pop())
br
Jörg
Am 04.02.19, 13:40 schrieb "Oberon im Auftrag von Tomas Kral" <oberon-bounces at lists.inf.ethz.ch im Auftrag von thomas.kral at email.cz>:
After applying your improvement, my `calc' now does adding, so
far only.
I do this.
123 Enter -> Push()
.123 Enter -> Push()
+ -> Push(Pop()+Pop())
Pop() -> result onto display
1.231230E+02
It is fun this RPN :-)
Simply I am not capable of precedence and infix.
Unary minus 1, I think, would take this form then.
0 Enter
1 Enter
-
Thank you.
--
Tomas Kral <thomas.kral at email.cz>
--
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
https://lists.inf.ethz.ch/mailman/listinfo/oberon
More information about the Oberon
mailing list