Integers

Data types are another important concept. When you are writing your own scripts you will soon see that there are many different types, for example strings, integers, vectors. Having a look at the Python online reference you will constantly come across these types with descriptions of functions:

  • setFps(int)
  • getDaemon(string)
  • getNeighvors(float)
  • getEulerAngles(vector)

 

The terms between brackets are the data types. This means that setFps(int), for example, only works with an integer number and is not allowed to work with other data types, like strings. A string in combination with frames per second would not make any sense:

setFps("Circle Emitter")

 

Instead you have to use a number and it has to be an integer, because there are no half or quarter frames. A frame is always a “complete” number:

setFps(24)

 

Integers are surely the easiest data type, as they only consist of numbers – no fractions like ¾ or ½, or things like 3.14159. Since integers can be very large, Python offers three different types:

  1. The 32-bit integer (int) ranges between ± 2,147,483,648
  2. The 64-bit integer (int) ranges between ± 9,223,372,036,854,775,808
  3. The long integer (long) has infinite precision