$LastChangedDate$ Scilab2C Data Annotations Scilab to C Converter : Data Annotations How To Description Data annotations are used to define the size, type and precisions of variables and numbers used in the Scilab code. By default Sci2C assumes the double precision, which is the default precision used by the Scilab language. Actually the whole Scilab software only works with double precision. Pay attention that the computation done in Scilab and the C code generated with single precision can differ. It is possible to force a default precision for each source file, by using a dedicated annotation that must be inserted after the function annotation section (Cf. Function Annotation.): This annotation specifies the default precision for all the data used in the function body. Allowed settings for precision are: If not otherwise specified, the precision of the data will be float single and float double, respectively. It is also possible to force some variable having a certain type using functions : float: forces a variable or a number or a matrix of numbers to be real float. double: forces a variable or a number or a matrix of numbers to be real double. floatcomplex: forces a variable or a number or a matrix of numbers to be complex float. doublecomplex: forces a variable or a number or a matrix of numbers to be complex double. Example 1 This will generate a C code with the y variable declared as a scalar, real, float. Example 2 Assuming is not present, the default precision will be This will generate a C code with x as scalar real double. y as 10 by 3 matrix of real double filled with zeros. z as scalar real double. In this case the double specifier is redundant. Example 3 This will generate a C code with x as scalar real float. y as 10 by 3 matrix of real float filled with zeros. In this case the float specifier is redundant. z as scalar real double. Example 4 This will generate a C code with x as scalar real double. y as scalar real double. z as scalar real double. According to the behaviour of + operator and due to the fact that x and y are both in double precision, Scilab2C will set z with double precision. See Also Sciab2C Annotations, Scilab2C Code Generator Authors Bruno JOFRET Raffaele NUTRICATO