Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6366

Data type for long numbers with floating point

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Could you show an example of that, please?

            Show
            serg Sergei Golubchik added a comment - Could you show an example of that, please?
            Hide
            PAleksandrov Petr added a comment -

            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).

            Show
            PAleksandrov Petr added a comment - 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 ).
            Hide
            serg Sergei Golubchik added a comment -

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

            Show
            serg Sergei Golubchik added a comment - ah, ok. This is our DECIMAL() data type, it already exists. See https://mariadb.com/kb/en/decimal
            Hide
            PAleksandrov Petr added a comment -

            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).

            Show
            PAleksandrov Petr added a comment - 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).
            Hide
            serg Sergei Golubchik added a comment -

            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?

            Show
            serg Sergei Golubchik added a comment - 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?
            Hide
            PAleksandrov Petr added a comment -

            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.

            Show
            PAleksandrov Petr added a comment - 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.

              People

              • Assignee:
                Unassigned
                Reporter:
                PAleksandrov Petr
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: