Numbers in Nasal
Jump to navigation
Jump to search
This article is a stub. You can help the wiki by expanding it. |
The FlightGear forum has a subforum related to: Nasal Scripting |
Nasal scripting |
---|
Nasal internals |
---|
Memory Management (GC) |
As one would expect, there are numbers in Nasal.
Representation types
Decimal
The most basic number system is the decimal system, based on the number 10. Decimal numbers can be written as integers, floating point numbers, or in exponential form.
Integer
Integers can be written as below:
var number = 1234; # 1,234
Floating point
Floating point numbers can be written as below:
var number = 1.234;
Exponential
Number written in exponential form take the form of number[E/e]power
var number = 12e6; # 12,000,000
number = 4E-2; # 0.04
Hexadecimal
Octal
Operators
See Nasal Operators for the main article about this subject. |