xrpn 1.2.1 → 1.3

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.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xrpn +1 -0
  3. data/xcmd/abs +1 -0
  4. data/xcmd/acos +1 -0
  5. data/xcmd/adate +1 -0
  6. data/xcmd/adateiso +1 -0
  7. data/xcmd/add +1 -0
  8. data/xcmd/adv +1 -0
  9. data/xcmd/agsub +1 -0
  10. data/xcmd/aleng +1 -0
  11. data/xcmd/almcat +1 -0
  12. data/xcmd/almnow +1 -0
  13. data/xcmd/anum +1 -0
  14. data/xcmd/aoff +1 -0
  15. data/xcmd/aon +1 -0
  16. data/xcmd/appchr +1 -0
  17. data/xcmd/apprec +1 -0
  18. data/xcmd/arcl +1 -0
  19. data/xcmd/arcli +1 -0
  20. data/xcmd/arclrec +1 -0
  21. data/xcmd/arot +1 -0
  22. data/xcmd/ashf +1 -0
  23. data/xcmd/asin +1 -0
  24. data/xcmd/asroom +1 -0
  25. data/xcmd/asto +1 -0
  26. data/xcmd/asub +1 -0
  27. data/xcmd/atan +1 -0
  28. data/xcmd/atime +1 -0
  29. data/xcmd/atime24 +1 -0
  30. data/xcmd/atox +1 -0
  31. data/xcmd/aview +1 -0
  32. data/xcmd/aviewc +1 -0
  33. data/xcmd/beep +1 -0
  34. data/xcmd/bindec +1 -0
  35. data/xcmd/cat +1 -0
  36. data/xcmd/cf +1 -0
  37. data/xcmd/chs +2 -1
  38. data/xcmd/cla +2 -1
  39. data/xcmd/clalma +1 -0
  40. data/xcmd/clalmx +1 -0
  41. data/xcmd/cld +1 -0
  42. data/xcmd/clear +1 -0
  43. data/xcmd/clfl +2 -1
  44. data/xcmd/clk12 +2 -1
  45. data/xcmd/clk24 +2 -1
  46. data/xcmd/clkeys +1 -0
  47. data/xcmd/clock +1 -0
  48. data/xcmd/clp +1 -0
  49. data/xcmd/clralms +1 -0
  50. data/xcmd/clrg +2 -1
  51. data/xcmd/clrgx +2 -1
  52. data/xcmd/cls +2 -1
  53. data/xcmd/clst +2 -1
  54. data/xcmd/clx +2 -1
  55. data/xcmd/cmdadd +2 -1
  56. data/xcmd/cmddel +2 -1
  57. data/xcmd/cmdhelp +23 -0
  58. data/xcmd/correct +1 -0
  59. data/xcmd/cos +1 -0
  60. data/xcmd/crflas +2 -1
  61. data/xcmd/crfld +2 -1
  62. data/xcmd/cube +2 -1
  63. data/xcmd/d_r +2 -1
  64. data/xcmd/date +2 -1
  65. data/xcmd/dateplus +2 -1
  66. data/xcmd/ddate +2 -1
  67. data/xcmd/dec +2 -1
  68. data/xcmd/decbin +2 -1
  69. data/xcmd/dechex +2 -1
  70. data/xcmd/decoct +2 -1
  71. data/xcmd/deg +2 -1
  72. data/xcmd/degq +2 -1
  73. data/xcmd/delchr +2 -1
  74. data/xcmd/delrec +2 -1
  75. data/xcmd/divide +2 -1
  76. data/xcmd/dmy +2 -1
  77. data/xcmd/dot +1 -0
  78. data/xcmd/dow +2 -1
  79. data/xcmd/drop +2 -1
  80. data/xcmd/dropy +2 -1
  81. data/xcmd/dse +1 -0
  82. data/xcmd/ed +1 -0
  83. data/xcmd/emdir +2 -1
  84. data/xcmd/emdirx +2 -1
  85. data/xcmd/emroom +1 -0
  86. data/xcmd/end +1 -0
  87. data/xcmd/eng +1 -0
  88. data/xcmd/enter +2 -1
  89. data/xcmd/exp +2 -1
  90. data/xcmd/expx1 +2 -1
  91. data/xcmd/fact +2 -1
  92. data/xcmd/fc +1 -0
  93. data/xcmd/fcc +1 -0
  94. data/xcmd/fcs +1 -0
  95. data/xcmd/fix +1 -0
  96. data/xcmd/fixq +2 -1
  97. data/xcmd/flsize +1 -0
  98. data/xcmd/frc +2 -1
  99. data/xcmd/fs +1 -0
  100. data/xcmd/fsc +1 -0
  101. data/xcmd/fss +1 -0
  102. data/xcmd/geir +2 -1
  103. data/xcmd/getas +2 -1
  104. data/xcmd/getfile +2 -1
  105. data/xcmd/getfilea +2 -1
  106. data/xcmd/getkey +2 -1
  107. data/xcmd/getkeyx +2 -1
  108. data/xcmd/getp +2 -1
  109. data/xcmd/getr +2 -1
  110. data/xcmd/getrec +2 -1
  111. data/xcmd/getrx +2 -1
  112. data/xcmd/getsub +1 -0
  113. data/xcmd/getweb +2 -1
  114. data/xcmd/getx +2 -1
  115. data/xcmd/grad +2 -1
  116. data/xcmd/gsb +1 -0
  117. data/xcmd/gto +1 -0
  118. data/xcmd/help +2 -1
  119. data/xcmd/hexdec +2 -1
  120. data/xcmd/hms +2 -1
  121. data/xcmd/hmsminus +2 -1
  122. data/xcmd/hmsplus +2 -1
  123. data/xcmd/hr +2 -1
  124. data/xcmd/inschr +2 -1
  125. data/xcmd/insrec +2 -1
  126. data/xcmd/int +2 -1
  127. data/xcmd/invf +1 -0
  128. data/xcmd/isg +1 -0
  129. data/xcmd/lastx +2 -1
  130. data/xcmd/lbl +1 -0
  131. data/xcmd/lift +2 -1
  132. data/xcmd/ln +2 -1
  133. data/xcmd/ln1x +2 -1
  134. data/xcmd/log +1 -0
  135. data/xcmd/mdy +2 -1
  136. data/xcmd/mean +2 -1
  137. data/xcmd/mod +1 -0
  138. data/xcmd/multiply +1 -0
  139. data/xcmd/oct +2 -1
  140. data/xcmd/octdec +2 -1
  141. data/xcmd/off +2 -1
  142. data/xcmd/on +1 -0
  143. data/xcmd/p_r +2 -1
  144. data/xcmd/pack +1 -0
  145. data/xcmd/page +1 -0
  146. data/xcmd/pagedel +1 -0
  147. data/xcmd/pageq +2 -1
  148. data/xcmd/pageswap +2 -1
  149. data/xcmd/pasn +1 -0
  150. data/xcmd/pcat +2 -1
  151. data/xcmd/pclps +2 -1
  152. data/xcmd/percent +1 -0
  153. data/xcmd/percentch +1 -0
  154. data/xcmd/pi +2 -1
  155. data/xcmd/posa +2 -1
  156. data/xcmd/posfl +2 -1
  157. data/xcmd/pow +2 -1
  158. data/xcmd/pprg +2 -1
  159. data/xcmd/pprgx +1 -1
  160. data/xcmd/pra +2 -1
  161. data/xcmd/prflags +2 -1
  162. data/xcmd/prompt +2 -1
  163. data/xcmd/prp +2 -1
  164. data/xcmd/prregs +2 -1
  165. data/xcmd/prstk +2 -1
  166. data/xcmd/prx +2 -1
  167. data/xcmd/prxm +2 -1
  168. data/xcmd/pse +2 -1
  169. data/xcmd/psize +1 -0
  170. data/xcmd/purfl +2 -1
  171. data/xcmd/r_d +1 -0
  172. data/xcmd/r_p +2 -1
  173. data/xcmd/rad +2 -1
  174. data/xcmd/rand +2 -1
  175. data/xcmd/rcl +1 -0
  176. data/xcmd/rclaf +1 -0
  177. data/xcmd/rclflag +2 -1
  178. data/xcmd/rclpt +2 -1
  179. data/xcmd/rclpta +2 -1
  180. data/xcmd/rclsw +1 -0
  181. data/xcmd/rdn +2 -1
  182. data/xcmd/recip +1 -0
  183. data/xcmd/regmove +2 -1
  184. data/xcmd/regswap +2 -1
  185. data/xcmd/reload +2 -1
  186. data/xcmd/reszfl +1 -0
  187. data/xcmd/rnd +2 -1
  188. data/xcmd/root +2 -1
  189. data/xcmd/rtn +2 -1
  190. data/xcmd/rubycmd +2 -1
  191. data/xcmd/runsw +1 -0
  192. data/xcmd/rup +2 -1
  193. data/xcmd/saveas +2 -1
  194. data/xcmd/savep +2 -1
  195. data/xcmd/saver +2 -1
  196. data/xcmd/saverx +2 -1
  197. data/xcmd/savex +2 -1
  198. data/xcmd/savexm +2 -1
  199. data/xcmd/sci +1 -0
  200. data/xcmd/sdev +2 -1
  201. data/xcmd/seekpt +2 -1
  202. data/xcmd/seekpta +2 -1
  203. data/xcmd/sep +1 -0
  204. data/xcmd/setaf +1 -0
  205. data/xcmd/setsw +1 -0
  206. data/xcmd/sf +1 -0
  207. data/xcmd/shellcmd +2 -1
  208. data/xcmd/sign +2 -1
  209. data/xcmd/sin +1 -0
  210. data/xcmd/size +1 -0
  211. data/xcmd/sizeq +1 -0
  212. data/xcmd/sminus +1 -0
  213. data/xcmd/splus +1 -0
  214. data/xcmd/sqr +2 -1
  215. data/xcmd/sqrt +2 -1
  216. data/xcmd/sreg +1 -0
  217. data/xcmd/sregq +2 -1
  218. data/xcmd/stdivide +1 -0
  219. data/xcmd/stmultiply +1 -0
  220. data/xcmd/sto +1 -0
  221. data/xcmd/stoflag +2 -1
  222. data/xcmd/stop +2 -1
  223. data/xcmd/stopsw +1 -0
  224. data/xcmd/stplus +1 -0
  225. data/xcmd/stsubtract +1 -0
  226. data/xcmd/subtract +1 -0
  227. data/xcmd/sw +1 -0
  228. data/xcmd/swap +2 -1
  229. data/xcmd/swpt +1 -0
  230. data/xcmd/tan +1 -0
  231. data/xcmd/tenx +2 -1
  232. data/xcmd/time +2 -1
  233. data/xcmd/tx +1 -0
  234. data/xcmd/version +1 -0
  235. data/xcmd/view +1 -0
  236. data/xcmd/writefile +2 -1
  237. data/xcmd/xeq +1 -0
  238. data/xcmd/xeq0 +2 -1
  239. data/xcmd/xeqnn +2 -1
  240. data/xcmd/xeqy +2 -1
  241. data/xcmd/xf +1 -0
  242. data/xcmd/xgt0 +2 -1
  243. data/xcmd/xgteq0 +2 -1
  244. data/xcmd/xgteqnn +2 -1
  245. data/xcmd/xgteqy +2 -1
  246. data/xcmd/xgtnn +2 -1
  247. data/xcmd/xgty +2 -1
  248. data/xcmd/xlt0 +2 -1
  249. data/xcmd/xlteq0 +2 -1
  250. data/xcmd/xlteqnn +2 -1
  251. data/xcmd/xlteqy +2 -1
  252. data/xcmd/xltnn +2 -1
  253. data/xcmd/xlty +2 -1
  254. data/xcmd/xmexistq +2 -1
  255. data/xcmd/xmfileq +2 -1
  256. data/xcmd/xneq0 +2 -1
  257. data/xcmd/xneqnn +2 -1
  258. data/xcmd/xneqy +2 -1
  259. data/xcmd/xnn +1 -0
  260. data/xcmd/xtoa +2 -1
  261. data/xcmd/xy +2 -1
  262. data/xcmd/xyzalm +1 -0
  263. data/xlib/_xrpn_version +1 -1
  264. data/xlib/debug_mode +2 -18
  265. data/xlib/read_xcmd +4 -4
  266. data/xrpn.gemspec +1 -1
  267. metadata +3 -2
data/xcmd/mean CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Statistical mean of X and Y values (to X and Y registers)
2
3
  def mean
3
4
  @l = @x
4
5
  lift
@@ -8,4 +9,4 @@ class XRPN
8
9
  end
9
10
  end
10
11
 
11
- # vim:ft=ruby:
12
+ # vim:ft=ruby:
data/xcmd/mod CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Y modulo X
2
3
  def mod
3
4
  @l = @x
4
5
  begin
data/xcmd/multiply CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Multiply X and Y
2
3
  def *
3
4
  @l = @x
4
5
  @x = @y * @x
data/xcmd/oct CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Convert decimal value in X to octal
2
3
  def oct
3
4
  decoct
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/octdec CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Take X as an octal number and convert to decimal number in X
2
3
  def octdec
3
4
  @l = @x
4
5
  @x = @x.to_s.convert_base(8, 10).to_f
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/off CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Ends XRPN.
2
3
  def off
3
4
  @flg["44"] = false
4
5
  exit
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/on CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Makes XRPN not end end on a single Enter in debug mode.
2
3
  def on
3
4
  @flg["44"] = true
4
5
  end
data/xcmd/p_r CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Polar to rectangular conversion
2
3
  def p_r
3
4
  @l = @x
4
5
  r = @x
@@ -10,4 +11,4 @@ class XRPN
10
11
  end
11
12
  end
12
13
 
13
- # vim:ft=ruby:
14
+ # vim:ft=ruby:
data/xcmd/pack CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Pack program (always packed)
2
3
  def pack
3
4
  return "PACK: No need for packing clothes or anything else."
4
5
  end
data/xcmd/page CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Make Page n the current working program Page
2
3
  def page (p)
3
4
  if p.to_i >= @prg.length
4
5
  return "Page number out of range."
data/xcmd/pagedel CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Delete Page n
2
3
  def pagedel (p)
3
4
  @prg.delete_at(p)
4
5
  return "Deleted page #{p}"
data/xcmd/pageq CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Prints current working Page
2
3
  def page?
3
4
  return "Page = #{@pg}"
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/pageswap CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Swap pages (page numbers in X and Y)
2
3
  def pageswap
3
4
  @prg[@x.to_i], @prg[@y.to_i] = @prg[@y.to_i], @prg[@x.to_i]
4
5
  return "Pages #{@x.to_i} and #{@y.to_i} swapped"
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/pasn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Programmable key assignment (no keys to assign to)
2
3
  def pasn
3
4
  return "PASN: This is not a calculator with keys to assign functions to."
4
5
  end
data/xcmd/pcat CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Show global program labels across all Pages
2
3
  def pcat
3
4
  @prg.each_index do |i|
4
5
  @prg[i].each do |l|
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/pclps CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Programmable Clear Programs (current and remaining programs)
2
3
  def pclps
3
4
  pr = "\"#{@a}\""
4
5
  page, pos = locate_prg (pr)
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/percent CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # X percent Y
2
3
  def %
3
4
  @l = @x
4
5
  @x = (@x * @y) / 100
data/xcmd/percentch CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Percentage change from Y to X
2
3
  def perch
3
4
  @l = @x
4
5
  @x = 100*((@x - @y) / @y)
data/xcmd/pi CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Get PI to X
2
3
  def pi
3
4
  lift
4
5
  @x = Math::PI
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/posa CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Find position of string in X in the Alpha register
2
3
  def posa
3
4
  @l = @x
4
5
  if @x.is_a? String
@@ -20,4 +21,4 @@ class XRPN
20
21
  end
21
22
  end
22
23
 
23
- # vim:ft=ruby:
24
+ # vim:ft=ruby:
data/xcmd/posfl CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Find position of string in Alpha in current XM file
2
3
  def posfl
3
4
  if @xmcont[0][0] == ""
4
5
  return
@@ -23,4 +24,4 @@ class XRPN
23
24
  end
24
25
  end
25
26
 
26
- # vim:ft=ruby:
27
+ # vim:ft=ruby:
data/xcmd/pow CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return Y to the power of X to X
2
3
  def pow
3
4
  @l = @x
4
5
  @x = @y ** @x
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/pprg CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Print program
2
3
  def pprg
3
4
  page = @pg
4
5
  pos = 0
@@ -24,4 +25,4 @@ class XRPN
24
25
  end
25
26
  end
26
27
 
27
- # vim:ft=ruby:
28
+ # vim:ft=ruby:
data/xcmd/pprgx CHANGED
@@ -1,6 +1,6 @@
1
1
  class XRPN
2
+ # Print current program from lines Y to X (relative to current line if Y is negative)
2
3
  def pprgx
3
- # Print current program from Y to X (relative to current line if Y is negative
4
4
  s = @y.to_i
5
5
  e = @x.to_i
6
6
  if (s == 0 and e == 0)
data/xcmd/pra CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print Alpha
2
3
  def pra
3
4
  puts "α = \"#{@a}\""
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/prflags CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Print status of all flags
2
3
  def prflags
3
4
  @flg = @flg.sort.to_h
4
5
  @flg.each_pair {|key, value| puts "#{key}: #{value}"}
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/prompt CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Prompts for input (does not enter debug mode as with STOP)
2
3
  def prompt
3
4
  puts @a.c_a(1)
4
5
  $prompt = true
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/prp CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print program
2
3
  def prp
3
4
  pprg
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/prregs CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Print content of all registers
2
3
  def prregs
3
4
  @reg = @reg.sort.to_h
4
5
  @reg.each_pair {|key, value| puts "#{key}: #{numformat(value)}"}
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/prstk CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Print Stack (including Alpha and L)
2
3
  def prstk
3
4
  puts "T = ".c_t + numformat(@t).c_t(1) + " α = ".c_a + @a.to_s.c_a(1)
4
5
  puts "Z = ".c_z + numformat(@z).c_z(1)
@@ -7,4 +8,4 @@ class XRPN
7
8
  end
8
9
  end
9
10
 
10
- # vim:ft=ruby:
11
+ # vim:ft=ruby:
data/xcmd/prx CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Print X
2
3
  def prx
3
4
  puts "X = " + numformat(@x)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/prxm CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Print content of eXtended Memory
2
3
  def prxm
3
4
  # Print content of current XM file
4
5
  out = ""
@@ -18,4 +19,4 @@ class XRPN
18
19
  end
19
20
  end
20
21
 
21
- # vim:ft=ruby:
22
+ # vim:ft=ruby:
data/xcmd/pse CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Pause program for one second
2
3
  def pse
3
4
  sleep(1)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/psize CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Programmable SIZE (no need for any sizeing)
2
3
  def psize
3
4
  return "PSIZE: No need for that function"
4
5
  end
data/xcmd/purfl CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Purge (remove) XM file
2
3
  def purfl
3
4
  f = Dir.home + "/.xrpn/data/" + @a
4
5
  fl = [f + ".pr", f + ".as", f + ".da"]
@@ -11,4 +12,4 @@ class XRPN
11
12
  end
12
13
  end
13
14
 
14
- # vim:ft=ruby:
15
+ # vim:ft=ruby:
data/xcmd/r_d CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Radians to degrees conversion
2
3
  def r_d
3
4
  @l = @x
4
5
  @x = @x * 180 / Math::PI
data/xcmd/r_p CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Rectangular to polar conversion
2
3
  def r_p
3
4
  @l = @x
4
5
  x = @x
@@ -15,4 +16,4 @@ class XRPN
15
16
  end
16
17
  end
17
18
 
18
- # vim:ft=ruby:
19
+ # vim:ft=ruby:
data/xcmd/rad CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Set degree mode to GRAD (400 degrees in a circle)
2
3
  def rad
3
4
  @deg = "rad"
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/rand CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return a random number between 0 and 1 to X
2
3
  def rand
3
4
  @l = @x
4
5
  lift
@@ -7,4 +8,4 @@ class XRPN
7
8
  end
8
9
  end
9
10
 
10
- # vim:ft=ruby:
11
+ # vim:ft=ruby:
data/xcmd/rcl CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Recall content of named register to X
2
3
  def rcl (r)
3
4
  x = false
4
5
  case r.downcase
data/xcmd/rclaf CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Recall clock accuracy factor (no clock function)
2
3
  def rclaf
3
4
  return "RCLAF: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/rclflag CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Recall flag status to X (uses different, more readable flag status format)
2
3
  def rclflag
3
4
  lift
4
5
  f = ""
@@ -13,4 +14,4 @@ class XRPN
13
14
  end
14
15
  end
15
16
 
16
- # vim:ft=ruby:
17
+ # vim:ft=ruby:
data/xcmd/rclpt CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Recall the pointer for current XM file to X
2
3
  def rclpt
3
4
  lift
4
5
  @x = @xmcont[0][3]
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/rclpta CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Recall the pointer for XM file (named in ALpha) to X
2
3
  def rclpta
3
4
  f = Dir.home + "/.xrpn/data/" + @a
4
5
  if File.exist?(f + ".as")
@@ -13,4 +14,4 @@ class XRPN
13
14
  end
14
15
  end
15
16
 
16
- # vim:ft=ruby:
17
+ # vim:ft=ruby:
data/xcmd/rclsw CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Recall stopwatch time (no stopwatch here)
2
3
  def rclsw
3
4
  return "RCLSW: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/rdn CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Roll down the stack
2
3
  def rdn
3
4
  @x, @y, @z, @t = @y, @z, @t, @x
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/recip CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return 1/X to X
2
3
  def recip
3
4
  @l = @x
4
5
  @x = 1 / @x
data/xcmd/regmove CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Move registers
2
3
  def regmove
3
4
  c = @x
4
5
  b = c.to_i
@@ -15,4 +16,4 @@ class XRPN
15
16
  end
16
17
  end
17
18
 
18
- # vim:ft=ruby:
19
+ # vim:ft=ruby:
data/xcmd/regswap CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Swap registers
2
3
  def regswap
3
4
  c = @x
4
5
  b = c.to_i
@@ -16,4 +17,4 @@ class XRPN
16
17
  end
17
18
  end
18
19
 
19
- # vim:ft=ruby:
20
+ # vim:ft=ruby:
data/xcmd/reload CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Reload all commands in the ./xrpn/cmd directory (makes it possble to modify or add commands while a program is running)
2
3
  def reload
3
4
  read_cmd
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/reszfl CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Resize XM file (no need, lots of room)
2
3
  def reszfl
3
4
  return "RESZFL: No need to resize files. Plenty of room here."
4
5
  end
data/xcmd/rnd CHANGED
@@ -1,8 +1,9 @@
1
1
  class XRPN
2
+ # Round X to current FIX number of decimal places
2
3
  def rnd
3
4
  @l = @x
4
5
  @x = @x.round(@i)
5
6
  end
6
7
  end
7
8
 
8
- # vim:ft=ruby:
9
+ # vim:ft=ruby:
data/xcmd/root CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return square root of X to X
2
3
  def root
3
4
  @l = @x
4
5
  @x = @y ** (1 / @x)
@@ -6,4 +7,4 @@ class XRPN
6
7
  end
7
8
  end
8
9
 
9
- # vim:ft=ruby:
10
+ # vim:ft=ruby:
data/xcmd/rtn CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Return program pointer to the last place in the return stack
2
3
  def rtn
3
4
  r = @rtn.pop
4
5
  if r == nil
@@ -9,4 +10,4 @@ class XRPN
9
10
  end
10
11
  end
11
12
 
12
- # vim:ft=ruby:
13
+ # vim:ft=ruby:
data/xcmd/rubycmd CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Evaluate the Ruby command in Alpha. Gives you access to all of Ruby inside XRPN.
2
3
  def rubycmd
3
4
  eval(@a)
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/runsw CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Run stopwatch (no stopwatch here)
2
3
  def runsw
3
4
  return "RUNSW: No clock, alarm or stopwatch functions are implemented"
4
5
  end
data/xcmd/rup CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Roll up the stack
2
3
  def rup
3
4
  @x, @y, @z, @t = @t, @x, @y, @z
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/saveas CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Save XM file
2
3
  def saveas
3
4
  save_xm
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/savep CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Save program
2
3
  def savep
3
4
  File.write(Dir.home + "/.xrpn/data/" + @a + ".pr", @prg[@pg])
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby:
data/xcmd/saver CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Save all registers to XM data file
2
3
  def saver
3
4
  if @a != ""
4
5
  if File.exist?(Dir.home + "/.xrpn/data/" + @a + ".da")
@@ -21,4 +22,4 @@ class XRPN
21
22
  end
22
23
  end
23
24
 
24
- # vim:ft=ruby:
25
+ # vim:ft=ruby:
data/xcmd/saverx CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Save a certain number of registers to XM data file
2
3
  def saverx
3
4
  b = @x.to_i
4
5
  e = (@x.frc * 1000).to_i
@@ -28,4 +29,4 @@ class XRPN
28
29
  end
29
30
  end
30
31
 
31
- # vim:ft=ruby:
32
+ # vim:ft=ruby:
data/xcmd/savex CHANGED
@@ -1,4 +1,5 @@
1
1
  class XRPN
2
+ # Save X to the current XM data file record
2
3
  def savex
3
4
  @xmcont[@xmcont[0][3] + 1] = @x
4
5
  @xmcont[0][3] += 1
@@ -7,4 +8,4 @@ class XRPN
7
8
  end
8
9
  end
9
10
 
10
- # vim:ft=ruby:
11
+ # vim:ft=ruby:
data/xcmd/savexm CHANGED
@@ -1,7 +1,8 @@
1
1
  class XRPN
2
+ # Save the current XM file to disk
2
3
  def savexm
3
4
  save_xm
4
5
  end
5
6
  end
6
7
 
7
- # vim:ft=ruby:
8
+ # vim:ft=ruby: