Seiki Batch Script > Structure

Floating Point Numbers

These are numbers with a possible fraction part like 12.34 and are represented by variables with an @ sign before the name and a decimal point in the constants. We can have all the same operations in floating point such as functions, user functions, assignments and mathematical formula. We added floating point numbers after Script had been in use for some time so there are functions left in the library to manage fractional numbers in integers that are now redundant but might be used in existing programs.

 

Having floating point numbers allows you to perform more complex mathematics such as

@hyp = @sqrt(@opposite*@opposite + @adjacent*@adjacent)

The only problems come when you mix floating point and integers because converting to an integer just chops off the fractional part and converting back cannot restore it.