Jump to content



Photo
* * * * * 4 votes

C.Basic - International Release

Casio Basic C.Basic

  • Please log in to reply
336 replies to this topic

#321 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 16 August 2019 - 04:42 AM

Thanks sentaro21. I'm updating.

#322 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 107 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:Playing video games (especially Minecraft), calculators, programming (Casio Basic/Basic-like,Scratch), watching memes, IT research, mathematics...

  • Calculators:
    fx-50FHII
    fx-9860GII Emulator (trial)
    fx-CG50 Emulator (trial)

Posted 16 August 2019 - 09:57 AM

Hi sentaro21,

 

I recently heard about C:Basic (compiler) but not fully understand.

 

Therefore, I have few questions:

  • What features are added?
  • Does it support all the calculators that C.Basic also support?
  • What is the current progress? (How much % is done, 0-100%) If 0%, which year/time will you start this compiler part?
  • In theory, how is the speed of C:Basic compared to C.Basic and Casio Basic?

Thanks for reading my questions. Keep up the good work!

 

Regards,

CalcLoverHK



#323 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 16 August 2019 - 10:59 AM

Sentaro21, I'm having a request if it's possible. Can we have the nimble matrices as unsigned?
I'm programming an algorithm for big number calculations (addition, subtraction etc) and I store each digit in a nimble matrix cell. But when i store any digit larger than 8 it makes it negative (understandable since it uses the highest order bit as sign) and causes problems. I don't want to use a byte matrix since it will double the needed storage (we're talking large numbers here with 2000 digits and such).
Is it possible to have some kind of flag, say like Mat a.Q to signify that a is an unsigned nibble matrix?
Thanks :)

Edited by tsiozos, 16 August 2019 - 11:43 AM.


#324 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 17 August 2019 - 02:52 AM

@CalcLoverHK
The progress of the C;Basic compiler is still around 10%. :bow:
More details will be given again, 
but not all commands can be supported initially. It starts with speeding up basic commands and formulas.
In the real version, more than 3x speed,
In the integer version it aims at over 10x speed. ^_^
 
 
@tsiozos
Ok!
I updated the trial version by changing 4 bit matrix to unsigned from signed. ^_^
If signed 4 bit are required, please use 8 bit.
 
2.23 beta for Graph 35+USB/35+EII/75/85/95 (SD) (trial version)
        -Changed 4bit matrix specification to unsigned from signed.
 
1.23 beta for Graph90+E/fx-CG10/20/50 (trial version)

Edited by sentaro21, 17 August 2019 - 02:54 AM.


#325 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 17 August 2019 - 07:32 AM

Thank you very much! I'm updating right now.



#326 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 17 August 2019 - 04:06 PM

Ok sorry to bother you every now but it seems I hit another bug with integers in real mode and For loops:
'#CBDBL
For 1->i% to 6
Disp i%
Next

This code makes the first loop i% takes the value of 1 then quits.
OTOH, the same loop in integer mode works fine. Also if i remove the % it works fine. If I increase the i% variable outside the loop with 1+i%->i% also works just fine. So, my guess is that integer variables confuse For loops or something.
Latest version of C.Basic.

#327 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 18 August 2019 - 03:42 AM

@tsiozos
I'm very thankful for bug reports every time. :D
"For~Next" bug had before, but I was able to fix it.
With this update, the executing speed of the loop itself will be about 3 times faster by using the integer variable the control variable in double mode. ^_^
 
This update will make 2.23 the official version. :)
 
2.23 beta for Graph 35+USB/35+EII/75/85/95 (SD)
        -Changed 4bit matrix sspecification to unsigned from signed.
 
1.23 beta for Graph90+E/fx-CG10/20/50
-Fixd the bug that not worked when the control variable of For~Next is different from the execution mode.
(Example) '#CBDBL
  For 1-> I% To 6
   Disp I%
  Next
 
-Changed 4bit matrix specification to unsigned from signed.

  • tsiozos likes this

#328 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 18 August 2019 - 07:10 AM

Thank you very much for the bug corrections. Makes my simulation much faster indeed!

One last little bug before you release the final 2.23:

sprintf function doesn't seem to work correctly when printing an integer variable with the %d sequence:

#CBDBL
1->i%
Disp sprintf("%d", i%)  -------> prints some weird number (probably some double bit equivalent) 1072693248

but
#CBDBL
1->i%
Disp sprintf("%f", i%)   -----------> prints correctly the value but as a double 1.00000



#329 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 18 August 2019 - 07:52 AM

If it is different from the execution mode, the argument of sprintf must specify the data type. :)
#CBDBL
1->i%
Disp Sprintf("%d", %i%)

Edited by sentaro21, 18 August 2019 - 07:53 AM.


#330 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted 18 August 2019 - 07:54 PM

But that's what i do and it doesn't work correctly.

Edited by tsiozos, 18 August 2019 - 08:07 PM.


#331 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted Yesterday, 01:20 AM

But that's what i do and it doesn't work correctly.

How is the output result?



#332 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted Yesterday, 05:59 AM

#CBDBL
1->i%
Disp sprintf("%d", i%)

casiocos.png

 

I get

1072693248



#333 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted Yesterday, 06:08 AM

Sorry,there was a bug left in fixing For~Next in 2.23. :banghead:
If use an integer variable for the control variable,
Fixed a bug that the end value and step value were expression evaluation in integer mode. 
'#CBDBL
6->E
For 1-> I% To E
 Disp I%
Next
The variable E should be evaluated with the double variable, but it was evaluated with the integer variable E%.
 

So, It was fixed and re-uploaded.
 
2.23 beta for Graph 35+USB/35+EII/75/85/95 (SD) 
 
1.23 beta for Graph90+E/fx-CG10/20/50
-Fixd the bug that not worked when the control variable of For~Next is different from the execution mode.
(Example) '#CBDBL
  For 1-> I% To 6
   Disp I%
  Next
 
-Changed 4bit matrix specification to unsigned from signed.
 
 
 

@tsiozos
#CBDBL
1->i%
Disp sprintf("%d", %i%)
Please add % before i%. ^_^
 

 

 


Edited by sentaro21, Yesterday, 06:23 AM.


#334 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted Yesterday, 08:24 AM

Thank you very much. It's unbelievable how fast you fix things!
Updating right now.

#335 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted Yesterday, 07:40 PM

Ok I'm officially impressed.
I've made an algorithm that multiplies very large numbers. I ran it with two 47-digit numbers.
Casio Basic: ~44 sec
C. Basic: 0.5 sec. Yes: half a sec!!

Amazing. We're in C++ territory here.
I'll upload the code to try it yourself.

#336 sentaro21

sentaro21

    Casio Freak

  • Members
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted Today, 05:22 AM

@tsiozos
About 80 times speed is amazing!!. :D
I'm looking forward to the program code. ^_^


#337 tsiozos

tsiozos

    Newbie

  • Members
  • Pip
  • 28 posts

  • Calculators:
    fx-9860gII

Posted Today, 11:27 AM

Posted here:

 

https://community.ca...-vs-casiobasic/







Also tagged with one or more of these keywords: Casio Basic C.Basic

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users