From the course: Grasshopper and Rhino: Python Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Numbers

Numbers

From the course: Grasshopper and Rhino: Python Scripting

Start my 1-month free trial

Numbers

- [Instructor] Python is made up of many different native data types including integers, float, strings, and booleans, all of which you'll be familiar with from using Grasshopper. In Python, let's have a look at two types that are commonly used in Grasshopper, the integer, and the float. Once we understand how the two different number types work, we'll look at using different arithmetic operators that we can utilize when using both types. Let's begin with integers. An integer is a whole number. It can be either positive or negative. Examples of these might be one or negative one. A float, on the other hand, can be thought of as a decimal point number as it contains a floating point, hence the name. For example, 0.1 or -1.3. When using integers and floats, it's important to know the limitations of both. As you know, integers are whole numbers and therefore exact in what they represent. There's no mistake that a whole number is as it appears. Floats, on the other hand, may appear exact…

Contents