Login    Sites MenuBlueStep

BlueStep Platform Support

RelateScript
Outline full outline 
Overview 
Data Types 
Text Data: String 
Whole Numbers: Integer 
Real Numbers: Float 
True/False Values: Boolean 
Dates and Times 
Time Periods: DateDiff 
Lists of Values: Arrays 
Operators 
Statements 
Functions 
Working with Relate Data 
How Formulas Work 
Related Topics 

A Float (short for floating-point number) is a number with a decimal, known in mathematics as a real number.  They use double-precision floating point numbers meaning they are accurate enough for all normal, every-day usage.  Unless you are using Relate Script for studying quantum physics, this should be good enough. In Relate Script, Float values can also be null, meaning no value or value unknown.  They are represented without an exponent as like this: 1.23 or 0.97 or with an exponent like this: 23.34e27 or 5.43e-21.  The "e" means the value should be multiplied by a power of ten.  In other words, move the decimal place left (negative exponent) or right (positive exponent) by this many decimal places.  This allows very, very large and very, very small numbers to be represented.  Sometime it can save some typing:  For instance 0.00000000001 is equal to 1E-11 and 20000000000 is equal to 2e10.

There are many operations that can be done on Floats, and they are discussed in the section on operators.

Geek Note: In Relate Script, all Floats are 64-bit IEEE 754 numbers, meaning they can represent virtually any number to a degree of precision greater than is needed for nearly any practical application (sort of). IEEE 754 numbers are binary representation of numbers.  Because of this most numbers cannot be represented perfectly.  For instance 0.1 cannot be represented in binary floating point for the same reason that 1/3 cannot be represented with normal decimal numbers you used in school:  It has an infinte repeating sequence after the decimal point (or more correctly the floating point).  Instead of an actual 0.1 you will get the closest value that can be represented.  Formatters can compensate when displaying the number since they round to the nearest decimal digit during conversion to a String value.  For instance, this code:

    output = "Do some subtraction: " + (3.3 - 2.2);

Puts the value "Do some subraction: 1.0999999999999996" in the output variable.  However, this code:

    output = "Do some subtraction: " + format(3.3 - 2.2, "#.#####");

Puts the improved value "Do some subtraction: 1.1" in the output variable by limiting the precision of the number to 5 decimal places.