Primitive Data Types

#1

What is the list of primitive types provided by the type system (i.e. double, int, string, long string, decimal, etc.)? What are the treatments of each of those types in: Sql, NoSql, Javascript runtime, Java runtime, python runtime?

0 Likes

#2

Numeric types:

  • integer
  • long int
  • byte
  • double
  • float
  • decimal

These are all stores as native number values in the RDBMS and their natural Java representations in the key/value store.

All these are represented as Number in JavaScript.

Other types:

  • string
  • boolean
  • datetime
  • json
  • binary

These are stored using the native types in the RDBMS. The atomic values above are stored in their natural Java representation in the key/value store. JSON is stored as a serialized string and binary is stored as a raw byte sequence.

In JavaScript, string boolean and json have natural representations. Datetime uses the C3 DateTime object. Binary uses the ES5 ArrayBuffer.

0 Likes

#3

why should we use double vs. float vs. decimal in our code?

0 Likes

#4

this is essentially correct: https://stackoverflow.com/questions/618535/difference-between-decimal-float-and-double-in-net

0 Likes