Welcome to thatlinuxbox.com Wednesday, September 27 2023 @ 02:30 PM UTC
Floating Point and Decimal Numeric Types
- Monday, January 10 2022 @ 05:35 PM UTC
- Contributed by: Dan Stoner
- Views: 521

Different programming languages and data storage engines use different names for IEEE 754 double-precision floating point (aka "approximate") numbers:
Language / Engine | IEEE 754 double-precision data type name |
---|---|
SQL (Strict Standard) | DOUBLE PRECISION |
PostgreSQL | double precision or float8 or float |
Avro | double |
Python | float or sqlalchemy.Float |
Java | Double |
Perl | Floats are platform dependent (double precision on 64-bit x86) |
C | double |
Go | float64 |
Rust | f64 |
Fixed precision Decimal types are often but not always provided by the stdlib:
Language | Fixed precision / decimal data type name |
---|---|
SQL (Strict Standard) | NUMERIC |
PostgreSQL | numeric |
Avro | NA |
Python | Decimal |
Java | BigDecimal |
Perl | Math::BigFloat (library) |
C | NA |
Go | decimal (via github.com/shopspring/decimal library) |
Rust | Decimal (via rust_decimal library) |
Floating point naming mahem:
The SQL Standard (SQL-99) defines the following approximate numeric data types:
- FLOAT specifies the data type approximate numeric, with binary precision equal to or greater than the value of the specified _precision_. The maximum value of _precision_ is implementation-defined. _precision_ shall not be greater than this value.
- REAL specifies the data type approximate numeric, with implementation-defined _precision_.
- DOUBLE PRECISION specifies the data type approximate numeric, with implementation-defined precision that is greater than the implementation-defined _precision_ of REAL.
PostgreSQL provides 'real' and 'double precision' but also supports the aliases 'float', 'float8', and 'float4'. The only alias that maps to 'real' is 'float4' (single precision). 'float' maps to 'double precision'.
At least in Python, where 'float' is the language data type for double precision floating point, a database abstraction layer would need to make some bad choices to end up with single precision / Real data type in the persistence layer when talking to a PostgreSQL backend.
The Avro storage enginue uses 'float' for single precision, and only 'double' is mapped to IEEE 754 double precision. At this point it is dubious to me what a python 'float' would get mapped to when writing to Avro.
- Comments (0)
New job - Database Administrator with IRIS
- Tuesday, May 04 2021 @ 02:50 PM UTC
- Contributed by: Dan Stoner
- Views: 1,241


This position is a true Remote job, so I will be working from my home office and hopefully occasionally from other interesting locations.
I assembled the sit-stand desk in my office from an UPLIFT Standing Desk Frame (V2-Commercial) and some used desk surfaces that I picked up from our local salvage yard, The Repurpose Project. This frame is fantastic, remarkably stable (no bounce when typing), and strong enough to support a lot of equipment or heavy surfaces.

- Comments (0)
Laptop Screen Height and Remote Work
- Wednesday, March 25 2020 @ 12:31 AM UTC
- Contributed by: Dan Stoner
- Views: 2,165

I know some people who stand up at a table or breakfast bar and use their laptops, but that is a terrible neck angle for long periods of time.
If your laptop will open to 180 degrees, then the following configuration with an external keyboard and mouse may help the screen position considerably:

Otherwise, I suggest a laptop stand such as this one from 1home:
https://www.amazon.com/gp/product/B077JZSBS2
which works very well compared to some others I have tried.
Here I am using it in combination with my Ergotron WorkFit sit-stand workstation:

- Comments (0)
New Job - DevOps Engineer
- Sunday, January 19 2020 @ 01:19 PM UTC
- Contributed by: Dan Stoner
- Views: 949

On my first day I received a laptop and my team suggested that I install Linux.

It is nice to be using Linux again full-time.
We are using GitOps practices with Flux and Kubernetes.
Nothing else much to report yet. I had some time to fiddle with my shell environment. zsh seems to be the popular shell these days so I played with it a little bit but instead decided to stick with Bash. I found a project similar to oh-my-zsh called oh-my-bash which I am using to customize my shell prompt.

- Comments (0)
New Job - Senior Site Reliability Engineer
- Saturday, December 15 2018 @ 08:10 PM UTC
- Contributed by: Dan Stoner
- Views: 3,181

On my first day they put me at a desk next to the window and I received a nice t-shirt (swag!).

The company just moved to a brand-new office building located in the mixed-use development known as Celebration Pointe.

As a long-time "Linux on the desktop" user, one of my initial challenges has been getting used to MacOS.

I am excited to have plenty of great things to learn. Besides on-the-job training, I am currently working thru a list of Linux Academy training courses. I finished up Docker Deep Dive this past week.

- Comments (0)