User Tools

Site Tools


Sidebar

Welcome to DIDO WIKI

dido:public:s_cli:05_contents:01_prt:03_langconst:05_types:start

3.5 Basic Types

BooleanValue

Return to Top

A BooleanValue represents a state in the Boolean logic and represents the results of a true/false proposition. For example, the two propositions, one asked as a question and the other a statement of fact can both be used.

  • Question: Is the Sky Blue?
  • Statement: The sky is blue.
BooleanValue ::= [FALSE | TRUE | UNKNOWN ]

IntegerNumber

Return to Top An Integer is a whole number (not a fraction) that can be positive, negative, or zero.

IntegerNumber ::=  ::= /^[+-]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/

PositiveWholeNumber

Return to Top A PositiveWholeNumber is an IntegerNumber that is greater than zero.

PositiveWholeNumber ::= /^[+]?([1-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/

NaturalNumber

Return to Top

A natural number is an integer greater than or equal to 0. Natural numbers begin at 0 and increment to infinity: 0, 1, 2, 3, 4, 5, etc.

NaturalNumber ::= /^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/

NegativeNumber

Return to Top A NegativeNumber is an IntegerNumber that is less than zero.

NegativeNumber ::= /^-?([1-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/

FixedNumber

Return to Top

A FixedNumber is characterized by the word length in bits, the position of the binary point, and the signedness of a number which can be signed or unsigned. Signed numbers and data types can represent both positive and negative values, whereas unsigned numbers and data types can only represent values that are greater than or equal to zero.1)

The position of the binary point is the means by which fixed-point values are scaled and interpreted.

* NOTE: Change the character ¿ to the number of decimals required. For example, if 2 decimal places are desired, change the ¿ to a 2.

FixedNumber ::= ^[0-9]*\.[0-9]{0,¿}$

FloatNumber

Return to Top

A FloatNumber is a Data Type composed of a number that is not just a IntegerNumber, but also includes a fraction. For example, the number Pi is a 3.14159. the 3 represent the whole number and the .14159 represents the fraction.

FloatNumber ::= ^[-+][0-9]+\.[0-9]+[eE][-+]?[0-9]+$

HexNumber

Return to Top

  • Hexadecimal is a base/positional number system used in mathematics and computer science. It has a base of 16 and uses 16 unique alpha-numeric symbols with the numbers zero to 9 to represent themselves and the letters A-F to represent the values 10 to 15.
  • Hexadecimal is an easier way to represent binary values in computer systems because they significantly shorten the number of digits, as one hexadecimal digit is equivalent to four binary digits.2)
HexNumber  ::= /^#?([a-f0-9]{6}|[a-f0-9]{3})$/

TextValue

Return to Top

A TextValue is a sequence of characters (Strings of characters) that is represented using UTF16.

TextValue  ::= /"(?:[^"\\]|\\.)*"/

IpAddressValue

Return to Top

An Internet Protocol Address (IP Address) is a numerical label assigned to each device connected network using the Internet Protocol (IP). IP addresses serves two main functions:

  • host or network interface identification
  • location addressing

The older Internet Protocol version 4 (IPv4) uses 32-bit number while IP (IPv6) uses 128 bits for the IP address.

IpAddressValue::= /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/

DateTimeValue

Return to Top

The DIDO-CLI uses the ISO Format for Date. See: ISO 8601-1:2019 Date and time -- Representations for information interchange -- Part 1: Basic rules

  • Called date in the column type in the database table field_config.
  • Stores the date in an ISO format (YYYY-MM-DDTHH:MM:SS).
  • The data is in a human-readable form.
  • You can use it for incomplete dates, i.e. only a year or only a year and a month, and pad the other values with zeros, so it does not appear to be any more precise than it really is.
  • Note: It is a format that is internationally-recognized, and it is used as-is on many web sites and in many applications.

Date Time is represented as String with YYYY-MM-DD HH:MM:SS ( See the Constant DATE_FORMAT_STRING For example, ''2008-09-01 12:35:45'

DateTimeValue ::= (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+|-](\d{2}):(\d{2})

TimestampValue

Return to Top

The DIDO-CLI uses Linux timestamps to capture TimestampValue.

Linux timestamps hold a number rather than a date and time. This number is the number of seconds since the Unix epoch, which was midnight (00:00:00) on January 1, 1970, in Coordinated Universal Time (UTC). Leap seconds are ignored in Linux timestamps, so they aren’t analogous to real time.
When Linux needs to display a timestamp, it translates the number of seconds into a date and time. This makes it easier for humans to understand. The location and time zone the computer viewing the file is in guides the conversion of the number of seconds to a date and time. It also ensures the month is in the correct language.
So, how many seconds can be stored in a timestamp? A lot—2,147,483,647, to be precise. That’s a big number, but is it enough? If you add that to the Unix epoch, and then translate it to a date and time, you get Tuesday, January 19, 2038, at 03:14:07 a.m. We’ll need a different scheme for timestamps before then, though.3)
DateValue ::= (Base32)
1)
MathWorks, Fixed-Point Concepts and Terminology, Accessed: 6 April 2021, https://www.mathworks.com/help/dsp/ug/concepts-and-terminology.html
2)
What Does Hexadecimal Mean?, Accessed: 8 April 2021, https://www.techopedia.com/definition/956/hexadecimal
3)
Dave McKay, Linux File Timestamps Explained: atime, mtime, and ctime, 12 February 2020, Accessed 8 April 2020, https://www.howtogeek.com/517098/linux-file-timestamps-explained-atime-mtime-and-ctime/
dido/public/s_cli/05_contents/01_prt/03_langconst/05_types/start.txt · Last modified: 2021/10/29 17:27 by nick
Translations of this page: