EasyManua.ls Logo

Casio ClassPad 300

Casio ClassPad 300
125 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Performing Operations on CBCDs
Most of the operations available to OBCDs are also available to CBCDs. A complete list
can be found in the ClassPad 300 SDK API Reference Guide under Math Functions-
>Complex (CBCD) Math Functions. Just like CBCD functions, these functions do not
return the result but a return code. Here is a simple example:
CBCD x, y;
Cal_longto_OBC(3, &x.repart);
Cal_longto_OBC(5, &x.impart);
Cal_longto_OBC(1, &y.repart);
Cal_longto_OBC(6, &y.impart);
if(Cal_add_CMP(&x, &y) != IM_CAL_NORM)
{
// an error occurred!
}
Converting CBCDs
Since CBCDs are complex numbers, they cannot be converted to longs or shorts like
OBCDs. You can, however, convert a CBCD to a string. The functions are very similar
to the ones used to convert CBCDs. You can view them all in the ClassPad 300 SDK
API Reference Guide under Strings->Functions to convert OBCD/CBCD data types to
strings.
Here is a quick example of converting a CBCD to a string:
CBCD x;
CP_CHAR buffer[30];
Cal_longto_OBC(1525, &x.repart); // set x = 1525
x.repart.obcd1.exponential = 0x1001;
Cal_longto_OBC(32, &x.impart);
CP_15digit_CMP(&x, buffer); // puts 15.25+32i in the buffer
BCD Converter Tool
The BCD Converter Tool is bundled with the SDK to simplify the creation of BCDs. It is
accessible under the Tools Menu of Dev-C++.
92

Table of Contents

Other manuals for Casio ClassPad 300

Related product manuals