[MDEV-6366] Data type for long numbers with floating point Created: 2014-06-19  Updated: 2015-11-17

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Petr Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: datatype, numbers


 Description   

Add a datatype for floating point numbers with user selected mantissa length.
I use long numbers with floating point in scientific calculations. It may be useful to allow storing such numbers in database.



 Comments   
Comment by Sergei Golubchik [ 2014-06-20 ]

Could you show an example of that, please?

Comment by Petr [ 2014-06-20 ]

An example of what? Of using such types?
I use them in numerical methods of solution of an initial value problem. In some cases the usual "double" type is not precise enough.
Also I use interval arithmetics to control rounding errors.
I have an idea to store calculation data (for example, time step) in a database. I know only one opensource DBMS which supports a numeric type with a long mantissa: PostgreSQL (NUMERIC type http://www.postgresql.org/docs/9.3/static/datatype-numeric.html).

Comment by Sergei Golubchik [ 2014-07-21 ]

ah, ok. This is our DECIMAL() data type, it already exists. See https://mariadb.com/kb/en/decimal

Comment by Petr [ 2014-07-22 ]

If I am not mistaken, it is a fixed-point type and the maximum number of digits is 65. So this type cannot represent such numbers as 10^300.
I need a floating point type (like "double" but with user selected mantissa length).

Comment by Sergei Golubchik [ 2014-07-22 ]

NUMERIC type in PostgreSQL is a fixed-point type too, as far as I can see. Our best match is DECIMAL type. But it doesn't support 300 digits of precision, indeed. So I suppose you want longer DECIMAL numbers, right?

Comment by Petr [ 2014-07-22 ]

No, I want a type like "REAL" but with a user selected precision (mantissa length). An exponenta length can be user selected or unlimited. For example, Boost (http://www.boost.org/doc/libs/1_55_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html) and GNU MPFR deals with such numbers.

Generated at Thu Feb 08 07:11:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.