So I am working on a program that requires the use of the Number to String routine via LinReg (I would use toString( but I want to ensure backwards compatibility). The trouble is is that LinReg can only convert numbers to strings for N<E50 instead of <E100 because the number must be squared to perform the residual analysis. I decided to use SinReg instead, and found that N can be as large as E64. Here is the subprogram I am using to implement it:
:{0,N,0,-N→L₃
:{0,π/2,π,3π/2→L₂
:SinReg 1,L₂,L₃,2π,Y₁
:Equ▶String(Y₁,Str1
:ClrList L₂,L₃
:DelVar Y₁sub(Str1,1,length(Str1)-9→Str1
The output to Str1 is correct, as the function produced by SinReg is N*sin(1x+0)+0. However, whenever I executed this subprogram in the main program, the program suddenly quits directly after it is finished executing. Any code after the line is ignored as if a Return or Stop statement was added after it; adding a Return to the end of the subprogram doesn't fix the problem.
This bug does not occur for the usual LinReg-based routine. I would simply switch back to LinReg, but I want to increase the upper limit for N as much as possible; if there is some method that can convert N without any upper limit I could avoid this problem altogether. Any assistance in either of these regards would be greatly appreciated.
The solution to a complex problem is often a simple answer.