mirror of
https://github.com/louisrubet/rpn
synced 2025-01-05 11:01:52 +01:00
72 lines
890 B
Text
72 lines
890 B
Text
## REAL representation
|
|
|
|
default erase
|
|
|
|
# real decimal
|
|
1
|
|
-> stack size should be 1
|
|
-> stack should be 1
|
|
drop
|
|
|
|
# real decimal (2)
|
|
2.345
|
|
-> stack should be 2.345
|
|
erase
|
|
|
|
# real decimal (3)
|
|
1 2.345 3 4.9
|
|
-> stack size should be 4
|
|
-> stack should be 1, 2.345, 3, 4.9
|
|
erase
|
|
|
|
# real hex
|
|
0x1234 0x10.10
|
|
-> stack should be 0x1.234p+12, 0x1.01p+4
|
|
|
|
# real hex (2)
|
|
dec swap dec swap
|
|
-> stack should be 4660, 16.0625
|
|
erase
|
|
|
|
# real binary
|
|
0b11001100
|
|
-> stack should be 204
|
|
erase
|
|
|
|
# real binary (2)
|
|
0b11001100.1101
|
|
-> stack should be 204.8125
|
|
erase
|
|
|
|
# real inf, nan
|
|
inf
|
|
@inf@
|
|
+inf
|
|
+@inf@
|
|
-inf
|
|
-@inf@
|
|
nan
|
|
@nan@
|
|
-> stack should be inf, inf, inf, inf, -inf, -inf, nan, nan
|
|
erase
|
|
|
|
# prec (1)
|
|
default
|
|
2 prec pi
|
|
-> stack should be 3
|
|
drop
|
|
|
|
# prec (2)
|
|
10 prec pi
|
|
-> stack should be 3.140625
|
|
drop
|
|
|
|
# prec error (1)
|
|
1 prec
|
|
-> error should be 4
|
|
|
|
# prec error (2)
|
|
0x8000000000000000 prec
|
|
-> error should be 4
|
|
|
|
default
|