Datatypes

ChaosPro’s internal programming language supports seven primitive types.

Six scalar types:

  • bool
  • int
  • real (double,float)
  • complex
  • quaternion
  • color

One compound type:

  • array

And finally a special type to mention, which is NOT supported:

  • NULL

Just like in almost all other programming languages variables first have to be declared before they can be used. On declaring a variable you must specify the variable type.

Examples

  • int a;
  • real b,c;
  • complex d;

Type conversions are done automatically from ChaosPro. Because there’s no string datatype many misleading situations simply cannot occur. There is no cast operator like in other programming languages.

Type conversions are done canonically, i.e. they do what you would do…:

Example

  real a;  complex b;    	b=(3,4);  	a=b; // a will contain 3, i.e. real part of complex number b  	b=a; // b will contain 3, i.e. the imaginary part of the complex number b will be set to 0  

Datatypes