skip to Main Content

Dear Ada Enthusiasts,

type Long_Money_Type is delta 10.0**(-22) digits 38;

On The First Machine Ubuntu Linux 64 bit GNAT 8.3.0 this works.
On The Second Machine Alpine Linux 64 Bit GNAT 10.3.1 20211027 i get this error:

adx-lib-money.ads:14:29: scale exceeds maximum value of 18
adx-lib-money.ads:14:54: digits value out of range, maximum is 18

Is There an way to change the maximum value ?

2

Answers


  1. This problem doesn’t occur with GCC 11 and later, so it looks as though you need to upgrade.

    Login or Signup to reply.
  2. Expanding on @Simon Wright’s answer, the Ada standard identifies certain Implementation-Defined Characteristics in a way that "allows for certain machine dependences in a controlled manner". In particular,

    What combinations of small, range, and digits are supported for fixed point types. See 3.5.9(10).

    As a concrete example, the GNAT 12.2 Reference Manual responds as follows:

    For a decimal fixed point type, on 32-bit platforms, the small must lie in 1.0E-18 .. 1.0E+18 and the digits in 1 .. 18. On 64-bit platforms, the small must lie in 1.0E-38 .. 1.0E+38 and the digits in 1 .. 38.

    As a result, when searching for a suitable upgrade, verify that you choose the 64-bit version if both are available.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search