-Fixed the bug that Alias for extension variables did not cause an error.
#561
Posted 15 January 2020 - 08:04 AM
#562
Posted 15 January 2020 - 09:00 PM
- piu58 and CalcLoverHK like this
#563
Posted 16 January 2020 - 08:30 AM
@Hilb2
Thank you for using C.Basic.
And fx-9860GIII has just annouced. You can check it out.
#564
Posted 16 January 2020 - 10:30 AM
#565
Posted 18 January 2020 - 05:18 PM
Hi sentaro21
I've post a thread about C.Basic to this "forum" (well, it is forum-like but not a forum): https://tieba.baidu....kw=计算器&ie=utf-8
https://tieba.baidu.com/p/6455559676
I hope more people there will know C.Basic.
Cheers
CalcLoverHK
Edited by CalcLoverHK, 21 January 2020 - 07:47 PM.
- diaowinner likes this
#566
Posted 19 January 2020 - 04:54 AM
#567
Posted 24 January 2020 - 11:32 AM
Edited by sentaro21, 24 January 2020 - 11:34 AM.
- CalcLoverHK and Hlib2 like this
#568
Posted 25 January 2020 - 05:43 PM
That is quite a much of improvement, thank you!
#569
Posted 26 January 2020 - 10:28 AM
Thank you always too!
#570
Posted 10 February 2020 - 08:52 AM
Edited by sentaro21, 11 February 2020 - 03:17 AM.
#571
Posted 22 February 2020 - 05:02 PM
1) in programming mode, in the FMEM option, it would be very nice to have the same softmenu as in the native CASIO-BASIC:[STO] [RCL] [fn] [SEE], not just the single [fn] as in C.BASIC. Since any set of characters can be written in fn, it is sometimes convenient to use these fn as ready-made templates when writing various repetitive constructs using the [SEE] and [RCL] commands.
2) the commands fn and Str_ behave similarly in most cases. Example:
?➝Str 1:?➝fn1:Str 1➝fn3 Disp Str 1:Disp fn1 Disp Str 1+fn1:Disp Exp(Str 1+fn1)Could you add commands like fn1➝Str 1 and fn1+Str 3➝Str 1 so that they don`t produce Syntax ERROR?
3) working with flags. In my opinion, these features are needed in C.BASIC. Even in such simple calculators as TI-83plus, these functions have been added to some libraries and programs. It turned out no worse than in HP calculators. The BatLib app for TI-83 has the dim(33 (FlagWrite) command. For example, dim(33,69,4) means: in group number 4 (graph settings), set the Dot, Sequential, GridOn, Rectangular, CoordOn, AxisOn, and LabelOn flags.
That is, d69=b1000101, and each of the seven positions in the binary number is responsible for the state of a particular flag in the group. It`s a bit complicated, but very effective. In C. BASIC, I suggest relevance at least two system variables StoFlags and RclFlags to quickly return to the original settings after changing them in some program.
4) suppose the program requests Input data?. I must enter either a vector [[1,2,3]] or a list {5,6,7} or a function a×x^2+b×x or a matrix or text. How can the program save the entered information correctly? It seems to me that in C.BASIC it is necessary to have one universal variable (UVar) for such cases. Pseudocode:
"Input data"?➝UVar:UVarType➝T ....... ....... If T=2:Then UVar➝_abc ........ ...... If T=5:Then UVar➝List 1 If T=8:Then UVar➝Str 1 ....... ....... If T=0:Then UVar➝Str 1 //an undefined type or incorrect syntax ×+÷cos(ABC}} is treated as a String type
Edited by Hlib2, 22 February 2020 - 07:00 PM.
#572
Posted 24 February 2020 - 03:58 AM
1) in programming mode, in the FMEM option, it would be very nice to have the same softmenu as in the native CASIO-BASIC:[STO] [RCL] [fn] [SEE],
2)Could you add commands like fn1➝Str 1 and fn1+Str 3➝Str 1 so that they don`t produce Syntax ERROR?
Exp>Str (fn1, Str 1) Exp>Str (fn1+Str 3, Str 1)
3) working with flags.
4) suppose the program requests Input data?.
?→_abc,List 1,Str 1 VarType:Ans (1:_abc, 2:List 1, 3:Str 1)
Edited by sentaro21, 24 February 2020 - 05:17 AM.
#573
Posted 24 February 2020 - 09:27 PM
1) I see, in C.BASIC fn and Y functions evaluate in algebraic expressions, but in Disp and Locate output they behave as String variables and don`t evaluate unlike in genuine BASIC. It seems to me that they should evaluate everyplace as in genuine BASIC without additional command Exp(, because that is their main difference from String. Only in this case, the absence of the fn➝Str N command is quite logical, in my opinion.
2) Please, add [Y] [r] [Xt] [Yt] x to the VARS/GRPH menu option, if possible.
3) I checked the text LCD output speed in RefrshCtl DD:off and RefrshCtl DD:Grph 5/128 mode.
ClrText For 1➝K To 50 Step 1 "1:ABCDEFGHIJKLMNOPQR" "2:ABCDEFGHIJKLMNOPQR" "3:ABCDEFGHIJKLMNOPQR" "4:ABCDEFGHIJKLMNOPQR" "5:ABCDEFGHIJKLMNOPQR" "6:ABCDEFGHIJKLMNOPQR" ClrText "7:STUVWYZABCDEFGHIJK" "8:STUVWYZABCDEFGHIJK" "9:STUVWYZABCDEFGHIJK" "10:STUVWYZABCDEFGHIJ" "11:STUVWYZABCDEFGHIJ" "12:STUVWYZABCDEFGHIJ" NextThe speed in C.BASIC was three times slower than in native BASIC. In RefrshCtl DD:All 5/128 mode, text output works fine, i.e. much faster than in genuine BASIC. What is the meaning of RefrshCtl DD:off mode?
Edited by Hlib2, 24 February 2020 - 09:37 PM.
#574
Posted 25 February 2020 - 02:53 AM
Thanks!
1) I see, in C.BASIC fn and Y functions evaluate in algebraic expressions, but in Disp and Locate output they behave as String variables and don`t evaluate unlike in genuine BASIC. It seems to me that they should evaluate everyplace as in genuine BASIC without additional command Exp(, because that is their main difference from String. Only in this case, the absence of the fn➝Str N command is quite logical, in my opinion.
2) Please, add [Y] [r] [Xt] [Yt] x to the VARS/GRPH menu option, if possible.
3) I checked the text LCD output speed in RefrshCtl DD:off and RefrshCtl DD:Grph 5/128 mode.
The speed in C.BASIC was three times slower than in native BASIC. In RefrshCtl DD:All 5/128 mode, text output works fine, i.e. much faster than in genuine BASIC. What is the meaning of RefrshCtl DD:off mode?
"RefrshCtl DD:off" is always transfers to the LCD at the end of the command.
#575
Posted 26 February 2020 - 02:07 AM
- Hlib2 likes this
#576
Posted 26 February 2020 - 02:28 AM
For users, there are other changes that does not list above. (build 2,3,6) If you wish to look up, please read Manual_EN.txt and ManualCG_EN.
And to clarify, 2.44 build 16 and 2.45 build 1 are the same version.
Edited by CalcLoverHK, 26 February 2020 - 02:29 AM.
#577
Posted 29 February 2020 - 06:59 PM
G SelOn, G SelOff (they need for drawing selected graphics by DrawGraph),
T SelOn, T SelOff, DispF-Tbl, F Result (although ➝F Start, ➝F End and ➝F pitch works),
➝Xt1, ➝Yt1, Graph(x,y)=(Xt1,Yt1),
Graph=0.2X^2,[1,2] (but without [1,2] works).
In the next short program
3➝A 5➝B Graph(X,Y)=(Xt1,Yt1)after "Syntax ERROR" the cursor points wrong place in front of "3" (in most other cases error pointing does properly).
#578
Posted 01 March 2020 - 03:16 AM
Thanks!
I'll consider to fix it.
#579
Posted 07 March 2020 - 03:41 PM
AsmPrgmEFD74A3A7884E61FC03E10EF ... etc ...or to make this function on ti-83 BASIC, but in 9860gii CASIO-BASIC I can`t do it. Are you planning to add this feature to CBASIC?
Edited by Hlib2, 07 March 2020 - 03:43 PM.
#580
Posted 07 March 2020 - 11:45 PM
Hi, Sentaro! Many thanks for the continuous improvement of CBASIC. The CASIOs now looks like a real math pocket computers. I have one small question: is it possible to implement the num-to-string function? This is really necessary in some programs. In ti-83_plus, for example, this is partially implemented in the OS with the LinReg(a+bx) command: LinReg(a+bx)_L1, L2, Y1: Equ►String(Y1, str1). In CASIO there is not ability to write system variables a,b to string or function as a numeric result. In ti-83 I can write this HEX-code directly on the calculator, like:
AsmPrgmEFD74A3A7884E61FC03E10EF ... etc ...or to make this function on ti-83 BASIC, but in 9860gii CASIO-BASIC I can`t do it. Are you planning to add this feature to CBASIC?
ToStr(123.456)→Str 1
Edited by sentaro21, 07 March 2020 - 11:46 PM.
#581
Posted 08 March 2020 - 09:06 AM
#582
Posted 08 March 2020 - 09:19 AM
Yes, the toStr( command is exactly what I meant, everything works fine with REAL/CPLX formats. Thank you very much!
#583
Posted 08 March 2020 - 02:39 PM
Hi sentaro21
I've post a thread about C.Basic to this "forum" (well, it is forum-like but not a forum): https://tieba.baidu....kw=计算器&ie=utf-8
https://tieba.baidu.com/p/6455559676
I hope more people there will know C.Basic.
Cheers
CalcLoverHK
It's 百度贴吧! I saw this.
#584
Posted 08 March 2020 - 04:08 PM
Hi diaowinner
It's 百度贴吧! I saw this.
Yes, this is Baidu Tieba, but unfortunately there are not as many people as in CnCalc interested in this. (^^;
Cheers
CalcLoverHK
#585
Posted 10 March 2020 - 02:55 AM
#586
Posted 10 March 2020 - 03:05 PM
Hi diaowinner
Yes, this is Baidu Tieba, but unfortunately there are not as many people as in CnCalc interested in this. (^^;
Cheers
CalcLoverHK
Right. It because you send it to “计算器吧”, but this “吧” is not popular than “fx-es(ms)吧”.
(Tips:the “fx-es(ms)吧” is more like "cnCalc" because “fx-es(ms)吧”'s friends do this “cnCalc”.)
#587
Posted 10 March 2020 - 06:38 PM
It's a very difficult job to implement each new feature. Thanks again for STO/RCL/fn/SEE. As for DispF-Tbl, I didn't mean for CBASIC to fully copy from genuine-BASIC. All we need to do is calculate the parameters and create the matrixAns variable (i.e. DispF-Tbl) as a ready-made table of results stored to matrix type.
Edited by Hlib2, 10 March 2020 - 06:43 PM.
#588
Posted 11 March 2020 - 03:33 AM
Thanks!
Deg "sin X"->GraphY1 "cos X"->GraphY2 1->F Start 5->F End 1->F pitch DispF-Tbl
Deg "sin X"->GraphY1 "cos X"->GraphY2 1->F Start 5->F End 1->F pitch Seq(X,X,F Start,F End,F pitch)->List 1 Seq(GraphY1,X,F Start,F End,F pitch)->List 2 Seq(GraphY2,X,F Start,F End,F pitch)->List 3 List->Mat(1,2,3)
#589
Posted 11 March 2020 - 06:12 PM
#590
Posted 12 March 2020 - 12:37 AM
#591
Posted 14 March 2020 - 12:51 PM
- Hlib2 likes this
#592
Posted 14 March 2020 - 05:34 PM
{9,3}➝Dim Mat A For 1➝I To 9 For 1➝J To 3 10×I +J➝Mat A[I,J] Next:Next:Mat A◢ // The matrix of integers with 9 rows × 3 columns for further manipulations T SelOff :VarRange // Here we define an independent parameter // using F_Start, F_End, F_pitch 1➝F Start:9➝F End 1➝F pitch "(Mat A[X,1]-X^2)"➝fn1 "fn1"➝Y1 // A strange feature in the AFX~9860 series. // The DispF-Tbl function does not allow you to directly use matrix variables // in Y variables, so we have to do it via fn. // Very uncomfortable. Could You fix this in CBASIC? "Mat A[X,2]÷(MOD(Mat A[X,2],3)=0)"➝fn2 "fn2"➝Y2 // From column 2 of matrix A we select only those numbers // that are evenly divisible by 3 "Mat A[X,3]"➝fn3 "fn3"➝Y3 DispF-Tbl◢ // Those results we weed out, in the table DispF-Tbl are replaced with ERROR
F Result➝Mat B◢ // The F_Result matrix includes only those rows that do not contain mathematical errors. // In this way, we can filter results according to the specified criteria
Mat➝List(B,1)➝List 1 VarList 1 // Here we define an independent parameter using the List_1 T SelOff :T SelOn 2 // The T_SelOn, T_SelOff settings in Table mode do not affect // the G_SelOn, G_SelOff settings in Graph mode, and vice versa DispF-Tbl F Result➝Mat C
Edited by Hlib2, 14 March 2020 - 05:52 PM.
#593
Posted 15 March 2020 - 05:26 AM
// A strange feature in the AFX~9860 series. // The DispF-Tbl function does not allow you to directly use matrix variables // in Y variables, so we have to do it via fn. // Very uncomfortable. Could You fix this in CBASIC?
#594
Posted 29 March 2020 - 07:46 PM
Angle:_Rad
Setup Recover:_on Max Mem Mode:_off
Use Hidn RAM:_on Hidn RAM Init:_on
Max List 52×1:_(52) Exec Time Dsp:_on
Mat Dsp:_m,n Storage mode:_S.Mem
Refrsh Ctl DD:_All 5/128 Execute mode:_DBL#
In V2, after running the program, the cursor is placed at the end of the text (in edit mode). In V1 the cursor does not change position after the program is executed, and this is much more convenient for multiple edits of the text, when you do not have to search for the old place each time to correct.
In V2, when viewing the CPLX matrix, scrolling is 20% slower than in the V1.
In both versions:
- the ClrMat_ command deletes all Lists in addition to Matrices;
- If you set Max Mem mode:_on, then the message File Reading..... always starts appearing even if you exit from text viewing mode without any editing. I don`t know if this is right.
In the V2 the speed of performing certain operations is noticeably reduced compared to the V1.
Below I give the results in DBL# mode as the number of operations per second
for different commands. In tests, I used 500row×1col lists, 500row×3col matrices,
and the expression
2×sin ((A+B)÷2)×cos ((A-B)÷2),
written in the functions Y5 and fn5.
1) List_2[K]➝List_3[K]8500 times per sec.(V1)/8200 times per sec.(V2)
2) Mat_A[K,2]➝Mat_A[K,3] 11100/10400
3) Y5➝R1200/570 times per second
calculates the expr.
2×sin ((A+B)÷2)×cos ((A-B)÷2). Amazingly!
4) 2×sin ((A+B)÷2)×cos ((A-B)÷2)➝R 880/750At this point,
what is very strange is that the direct calculation of an expression
in v2.44build6 is much slower than the calculation via the "Y" function, (1200 vs 880).
5) fn5(K)➝R 780/680 6) For ... Next 37000/33500 7) Y5(K)➝R 1125/625 8) S+1÷K➝S 3500/3500That`s all I noticed. In other modes and functions, the speed discrepancy is minimal, so I don`t give all the results.
Edited by Hlib2, 29 March 2020 - 08:33 PM.
#595
Posted 30 March 2020 - 05:59 AM
- the ClrMat_ command deletes all Lists in addition to Matrices;
- If you set Max Mem mode:_on, then the message File Reading..... always starts appearing even if you exit from text viewing mode without any editing. I don`t know if this is right.
3) Y5➝R1200/570 times per second
2×sin ((A+B)÷2)×cos ((A-B)÷2). ↓ 2×(sin ((A+B)÷2)×cos ((A-B)÷2))).
#596
Posted 31 March 2020 - 09:13 PM
Thank you for the hint regarding binary calculations. I tested this method in versions v2. 44/6 and v2. 45/15 on the 9860gii-2 calculator and measured the calculation speed in a loop for different expressions:
1) expression➝R
2) Y5➝R
3) Y5(K)➝R
4) fn5➝R
5) fn5(K)➝R
Also, I wrote the expression in functions in two ways
(expr) and (expr))
and received five different results in twenty experiments (5 examples × 2 variants × 2 versions):
a) ( -- ) slowdown 5...25% b) (++) speedup 25...45% c) ( -- )) slowdown 5% d) ( ++ )) speedup 0...45% e) (...)) syntax errorFunctions like Y in v2. 44/6 are set to maximum speed by default, and adding extra brackets to the expression slows down calculations.
In v2. 45/15, in functions 3) and 5), ( # # # ) gives the minimum speed, and ( # # # )) gives the maximum speed.I hope this information can be useful.
Edited by Hlib2, 31 March 2020 - 09:16 PM.
#597
Posted 01 April 2020 - 07:39 AM
"Bench (C.Basic "+ToStr(Int (Version/100))+"."+ToStr(MOD(Version,100))+")"
Rad
"2*_sin _((A+B)/2)*_cos _((A+B)/2)"->fn5
"2*(_sin _((A+B)/2)*_cos _((A+B)/2)"->fn6
"2*_sin _((A+B)/2)*_cos _((A+B)/2)"->GraphY5
"2*(_sin _((A+B)/2)*_cos _((A+B)/2)"->GraphY6
Gosub A
Gosub B
Gosub C
Gosub D
Gosub E
Gosub F
Gosub G
Stop
Lbl A
"Loop"->Str 1
0->S:0->Ticks
Do
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl B
"Expression"->Str 1
0->S:0->Ticks
Do
2*sin ((A+B)/2)*cos ((A+B)/2)->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl C
"(Expression)"->Str 1
0->S:0->Ticks
Do
2*(sin ((A+B)/2)*cos ((A+B)/2)->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl D
"_GraphY_5"->Str 1
0->S:0->Ticks
Do
GraphY5->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl E
"(_GraphY_6)"->Str 1
0->S:0->Ticks
Do
GraphY6->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl F
"fn5"->Str 1
0->S:0->Ticks
Do
fn5->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl G
"(fn6)"->Str 1
0->S:0->Ticks
Do
fn6->R
Isz S
LpWhile Ticks<128
Gosub S
Return
Lbl S
StrLeft(Str 1+" ",15)+StrRight(" "+ToStr(S),5
Return
#598
Posted 01 April 2020 - 06:17 PM
If you don`t mind, could you create a benchmark program?
It`s an interesting thought! The test program will greatly simplify the verification and comparison procedure. As source constants, we could take the best results from the last two versions, for example, and output relative changes of ± % in any other version, as well as absolute speed values. I will try to write a test at the end of the week.
#599
Posted 10 April 2020 - 09:19 AM
@Sentaro
I have a few questions about v2. 45.
1) When working with multiple matrices in program, they sometimes change the specification (m,n)↔(x,y). Columns and rows are swapped, which causes a Dimension ERROR message or an incorrect result.
2) When accessing subroutines like
Gosub X, P, T, 2, Y: ... Lbl X: Local a, b, c, d: ... writing local parameters is often ignored, leaving them equal to zero.
3) After handling with arrays in program, the list of variables displays Lst θ [byte] or Mat θ [byte] size of 2×256. Is this a mistake, or should it be?
4) The List_1+i×List_2➝List_5 operation is not working. `#CBcplx:10➝DimList_5 (for example) doesn`t help. But creating an array in the loop :For ... List_1[K]+i×List_2[K]➝List_5[K] ... Next: works well.
5) Seq(X,X,1,3,0.02) or Seq(X,X,1,1.2,0.05) operation loses the last element of the array, stopping at the value 2.95 or 1.15. This is probably due to rounding a number in the binary representation?
6)
-(2^32)+2×(2^15) ➝Ticks% While Ticks%<-(2^15):WhileEnd Disp Ticks%The answer is -32720, Execute Time = 1.0219 s.
When storing, Ticks% change the sign of the argument, but returns the argument without changing the sign.
So, -(2^32)+2×2^15 = -(2×2^15)?
In the benchmark, I decided to make several pages of 8 points (tests) each. The main menu allows you to scroll through pages bу▼◄ ► buttons and quickly evaluate the results
For detailed information, we can select an item using the ... keys and scroll through the items in the information list. The tests are compared with benchmarks that we use as constants. "1.25 -" means 1.25 times slower, "1.51 +" means 1.51 times faster.
The last couple of pages I plan to use to check standard algorithms for errors in a particular version. I think this approach will make it easier to learn C.Basic.
#600
Posted 10 April 2020 - 01:04 PM
1) When working with multiple matrices in program, they sometimes change the specification (m,n)↔(x,y). Columns and rows are swapped, which causes a Dimension ERROR message or an incorrect result.
2) When accessing subroutines like
Gosub X, P, T, 2, Y: ... Lbl X: Local a, b, c, d: ... writing local parameters is often ignored, leaving them equal to zero.
Local a,b,c Gosub A,1,2,3 Gosub B,1,2,3 Stop Lbl A Disp a,b,c Return Lbl B Dsip a+b+c Return
3) After handling with arrays in program, the list of variables displays Lst θ [byte] or Mat θ [byte] size of 2×256. Is this a mistake, or should it be?
4) The List_1+i×List_2➝List_5 operation is not working. `#CBcplx:10➝DimList_5 (for example) doesn`t help. But creating an array in the loop :For ... List_1[K]+i×List_2[K]➝List_5[K] ... Next: works well.
5) Seq(X,X,1,3,0.02) or Seq(X,X,1,1.2,0.05) operation loses the last element of the array, stopping at the value 2.95 or 1.15. This is probably due to rounding a number in the binary representation?
When storing, Ticks% change the sign of the argument, but returns the argument without changing the sign.
So, -(2^32)+2×2^15 = -(2×2^15)?
Also tagged with one or more of these keywords: Casio Basic C.Basic
General →
Your Projects →
Inside Casio Basic is now to be preparedStarted by Krtyski , 02 Dec 2016 Casio Basic C.Basic |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users