t-rex 2.0.1 → 2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/t-rex +12 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e26ed814ef64c7de43f05514e3a9fad738f94b43279d134e021539ed2dc4a996
|
4
|
+
data.tar.gz: 11f7f34f9ec6822c8520f9a9ea8b422cecf7518172fc9c02a3ec1dce8a745c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54dde9c96ddb5b10b324d0c3bb2b459960a7e395550d2f1a04a0774cba06da7e404df495bd5392555c588f3aaaaf25f23a4337a9d0eeb6aa3dcebb1bc2adb98b
|
7
|
+
data.tar.gz: 23cc5bad45026e181f5d95990d10bf308f029cbfec9c01fed87f95dca277dba785560d3828f5af77e7173427a6783f3547de6d6f28797925c24f3f1ab2301ccd
|
data/bin/t-rex
CHANGED
@@ -28,6 +28,9 @@ help = <<HELPTEXT
|
|
28
28
|
operating stack. L is the "Last X" register showing the previous value in X.
|
29
29
|
Toggle US and European number formats by pressing '.
|
30
30
|
|
31
|
+
When entering a number into X, use 'h' to change the sign and 'e' to write an
|
32
|
+
exponent (10^x). Entering "123e4" becomes "1230000".
|
33
|
+
|
31
34
|
Functions available are shown under the stack registers. The orange symbol
|
32
35
|
corresponds to the key to be pressed. For functions above each label (grey
|
33
36
|
functions), press the Control key (Ctrl) and the orange key (asin = Ctrl+i).
|
@@ -632,7 +635,7 @@ def entry(chr) # X REGISTER ENTRY
|
|
632
635
|
pos = 1
|
633
636
|
Rcurses::Cursor.set(7,33)
|
634
637
|
Rcurses::Cursor.show
|
635
|
-
while %w[0 1 2 3 4 5 6 7 8 9 . , h RIGHT LEFT HOME END DEL BACK WBACK LDEL].include?(chr)
|
638
|
+
while %w[0 1 2 3 4 5 6 7 8 9 . , h e RIGHT LEFT HOME END DEL BACK WBACK LDEL].include?(chr)
|
636
639
|
@p_x.puts(num)
|
637
640
|
chr = getchr
|
638
641
|
case chr
|
@@ -676,6 +679,9 @@ def entry(chr) # X REGISTER ENTRY
|
|
676
679
|
num.insert(0, "-")
|
677
680
|
pos += 1
|
678
681
|
end
|
682
|
+
when 'e'
|
683
|
+
num.insert(pos,chr)
|
684
|
+
pos += 1
|
679
685
|
when /[0-9.,]/
|
680
686
|
num.insert(pos,chr)
|
681
687
|
pos += 1
|
@@ -684,6 +690,11 @@ def entry(chr) # X REGISTER ENTRY
|
|
684
690
|
end
|
685
691
|
num = "" if %w[DOWN UP].include?(chr)
|
686
692
|
num.gsub!(/,/, '.')
|
693
|
+
if num.include?("e")
|
694
|
+
n = num.split("e").first(2)
|
695
|
+
n[1] = (10 ** n[1].to_i)
|
696
|
+
num = n.join
|
697
|
+
end
|
687
698
|
num != "" ? number = num.to_f : number = ""
|
688
699
|
Rcurses::Cursor.hide
|
689
700
|
return number, chr
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t-rex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rcurses
|
@@ -26,8 +26,8 @@ dependencies:
|
|
26
26
|
version: '2.4'
|
27
27
|
description: 'This is a terminal curses RPN calculator similar to the traditional
|
28
28
|
calculators from Hewlett Packard. See https://www.hpmuseum.org/rpn.htm for info
|
29
|
-
on RPN (Reverse Polish Notation). New in 2.
|
30
|
-
|
29
|
+
on RPN (Reverse Polish Notation). New in 2.1: Added ''e'' for entering exponents
|
30
|
+
directly into X.'
|
31
31
|
email: g@isene.com
|
32
32
|
executables:
|
33
33
|
- t-rex
|