Problem with sprintf in miniSDK 1.09
4 posts
• Page 1 of 1
- sentaro21
- Member
-
- Posts: 30
- Joined: Mon Oct 27, 2014 1:46 pm
- Location: Japan
- Calculators: Casio Cfx Series, Casio fx-9860G, Casio fx-9860GII, Casio fx-9860GII SD Power Graphic 2, Casio fx-CG10, Casio fx-CG20, Casio fx-CG50
Problem with sprintf in miniSDK 1.09
Hello
I'm using miniSDK 0.9 by development of the C.Basic for CG now.
Because it is the transplant from the C.Basic for FX,
I'm very thankful at all for compatibility with FX-SDK.
And it was impossible without fx-document.
It is very usefull document!
Thanks so very much.
By the way,
There is a problem only a little here.
sprintf from the FX-SDK library is slightly strange,
(example)
a=0.123
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+00
a=1.23
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+01
a=12.3
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+02
a=0.123
sprintf( buffer,"%f",a);
result of buffer-> 0.123000
a=1.23
sprintf( buffer,"%f",a);
result of buffer-> 01.230000
a=12.3
sprintf( buffer,"%f",a);
result of buffer-> 012.300000
a=0.123
sprintf( buffer,"%g",a);
result of buffer-> 0.123
a=1.23
sprintf( buffer,"%g",a);
result of buffer-> 01.23
a=12.3
sprintf( buffer,"%g",a);
result of buffer-> 012.3
Does this have the possibility that can revise?
and,
Is there the system call for the free space of the storage memory in CG10/20/50?
(---edit---)
I misunderstood the version of mini SDK.
I'm very sorry.
It was 1.09 not 0.9
I'm using miniSDK 0.9 by development of the C.Basic for CG now.
Because it is the transplant from the C.Basic for FX,
I'm very thankful at all for compatibility with FX-SDK.
And it was impossible without fx-document.
It is very usefull document!
Thanks so very much.

By the way,
There is a problem only a little here.
sprintf from the FX-SDK library is slightly strange,

(example)
a=0.123
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+00
a=1.23
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+01
a=12.3
sprintf( buffer,"%e",a);
result of buffer-> 0.123000e+02
a=0.123
sprintf( buffer,"%f",a);
result of buffer-> 0.123000
a=1.23
sprintf( buffer,"%f",a);
result of buffer-> 01.230000
a=12.3
sprintf( buffer,"%f",a);
result of buffer-> 012.300000
a=0.123
sprintf( buffer,"%g",a);
result of buffer-> 0.123
a=1.23
sprintf( buffer,"%g",a);
result of buffer-> 01.23
a=12.3
sprintf( buffer,"%g",a);
result of buffer-> 012.3
Does this have the possibility that can revise?
and,
Is there the system call for the free space of the storage memory in CG10/20/50?
(---edit---)
I misunderstood the version of mini SDK.
I'm very sorry.
It was 1.09 not 0.9
Last edited by sentaro21 on Thu Jan 11, 2018 10:52 am, edited 2 times in total.
- AmazoNKA
- Senior Member
- Posts: 116
- Joined: Mon Mar 02, 2015 10:53 am
- Calculators: Casio fx-CG20
Re: Problem with sprintf in miniSDK 0.9
I know of this call for free space routine http://prizm.cemetech.net/index.php/Bfi ... diaFree_OS
- AmazoNKA
- Senior Member
- Posts: 116
- Joined: Mon Mar 02, 2015 10:53 am
- Calculators: Casio fx-CG20
Re: Problem with sprintf in miniSDK 0.9
The following worked for me some time ago:
unsigned short smemMedia[7]={'\\','\\','f','l','s','0',0};
int freespace;
Bfile_GetMediaFree_OS( smemMedia, &freespace );// the free space in bytes on the storage memory is now on freespace.
unsigned short smemMedia[7]={'\\','\\','f','l','s','0',0};
int freespace;
Bfile_GetMediaFree_OS( smemMedia, &freespace );// the free space in bytes on the storage memory is now on freespace.
- sentaro21
- Member
-
- Posts: 30
- Joined: Mon Oct 27, 2014 1:46 pm
- Location: Japan
- Calculators: Casio Cfx Series, Casio fx-9860G, Casio fx-9860GII, Casio fx-9860GII SD Power Graphic 2, Casio fx-CG10, Casio fx-CG20, Casio fx-CG50
Re: Problem with sprintf in miniSDK 0.9
AmazoNKA wrote:The following worked for me some time ago:
unsigned short smemMedia[7]={'\\','\\','f','l','s','0',0};
int freespace;
Bfile_GetMediaFree_OS( smemMedia, &freespace );// the free space in bytes on the storage memory is now on freespace.
It works very well!
Thanks very much!

4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 31 guests