Welcome to thatlinuxbox.com Tuesday, March 19 2024 @ 02:55 AM UTC

Floating Point and Decimal Numeric Types

View Printable Version
  • Monday, January 10 2022 @ 05:35 PM UTC
  • Contributed by:
  • Views: 620
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

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.

 

New job - Database Administrator with IRIS

View Printable Version
  • Tuesday, May 04 2021 @ 02:50 PM UTC
  • Contributed by:
  • Views: 1,354
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

Last week I started my new job as a Database Administrator (DBA) with Incorporated Research Institutions for Seismology (IRIS). My focus will be working on PostgreSQL databases.



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.


Laptop Screen Height and Remote Work

View Printable Version
  • Wednesday, March 25 2020 @ 12:31 AM UTC
  • Contributed by:
  • Views: 2,698
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

I prefer a standing desk. With the COVID-19 work from home orders causing me to become a full-time Remote worker, my home desk area setup is much more important than it was before.

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:


New Job - DevOps Engineer

View Printable Version
  • Sunday, January 19 2020 @ 01:19 PM UTC
  • Contributed by:
  • Views: 1,053
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

In December I started my new job at Infinite Energy, Inc. as a DevOps Engineer. What attracted me to this job the most was the Culture of the company and the high levels of awareness of the managers that I met.

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.


New Job - Senior Site Reliability Engineer

View Printable Version
  • Saturday, December 15 2018 @ 08:10 PM UTC
  • Contributed by:
  • Views: 3,302
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

Just after Thanksgiving I started my new job as a Senior Site Reliability Engineer for SharpSpring which is located here in Gainesville, Florida.

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.


First | Previous | 1 234567| Next | Last

User Functions

Login

Connect

thatlinuxbox.com is the home of Dan Stoner's Personal Blog, Photos, and More (opinions, rants, techno-babble, and possibly a few useful tidbits of knowledge).

Questions or Comments about this site? Contact danstoner _ at _ gmail.com.

RSS Feed for this blog

Other places to find me on the web:

Twitter

LinkedIn

GitHub

Support This Site

If you like something that you find on this site, please consider making a purchase through one of the links below or sending me an item from my Amazon Wish List.


The Clymb


Awesome VPS hosting by Linode.com