Page 1 of 1

Dobble byte and fractions

Posted: Fri Jun 01, 2007 12:21 am
by RAMTEC
I need make operations with numbers more high than 255. How i can declare variable like dobble byte and, how i make operations where the result could be fractions, example, A = 10/6.
Thank you

Posted: Fri Jun 01, 2007 9:16 am
by Benj
Hello

To create a number that is more then 8 bit you need to move to 16 or 32 bit.

A 16 bit number is declared as an Int and a 32 bit number is declared as a float. You need to go to the Support section of the website to get the 32 bit library for Flowcode.

http://www.matrixmultimedia.com/support ... .php?t=505

Im afraid the result cannot be a fraction unless you use two variables to hold to top and bottom halves of the equation. This may also be fairly tricky to program.

Posted: Fri Jun 01, 2007 2:59 pm
by RAMTEC
Hi Ben.
I forgot something, i am using v2.0

Posted: Fri Jun 01, 2007 3:08 pm
by Benj
Ah I see. Yes version 2 of Flowcode only has byte variables.

The C compiler that Flowcode V2 uses is called C2C. This does support 16 bit integer variables. You can therefore create a variable in C using a C code icon.

for example

int number;
number = 11024;
number = number + 1;
number = FCV_BYTE1;