Re: remark on defining size of basic types

Liste des GroupesRevenir à cl c  
Sujet : Re: remark on defining size of basic types
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.c
Date : 05. Apr 2024, 02:46:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uunhls$vbtu$2@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Fri, 5 Apr 2024 02:25:22 +0200, Janis Papanagnou wrote:

On 05.04.2024 01:38, Lawrence D'Oliveiro wrote:
>
On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
 
Sometimes it's useful to have an unbounded or parameterized integral
data type available ...
 
Interestingly, Fortran (of all things) has that.
 
Was that the e.g. '*8' syntax? - Did it allow arbitrary lengths?

No, and no. Since Fortran 2003, you can parameterize a custom type
definition with integer values. These can be used to specify the sizes of
arrays, or they can be used as codes for the different (implementation-
defined) precisions of integer and real types. An example from the
language spec:

    TYPE :: t1(k1,k2)
        INTEGER, KIND :: k1,k2
        REAL(k1) a(k2)
    END TYPE

This defines a custom type “t1”, which is an array of reals; the first
parameter determines the precision of the reals, and the second one
specifies the length of the array.

There are various query mechanisms (built-in functions, standard modules)
to determine the valid values of the number-precision codes.

Date Sujet#  Auteur
4 Apr 24 * remark on defining size of basic types21fir
4 Apr 24 `* Re: remark on defining size of basic types20Lawrence D'Oliveiro
4 Apr 24  `* Re: remark on defining size of basic types19fir
4 Apr 24   `* Re: remark on defining size of basic types18Lawrence D'Oliveiro
4 Apr 24    `* Re: remark on defining size of basic types17fir
4 Apr 24     `* Re: remark on defining size of basic types16Janis Papanagnou
4 Apr 24      +* Re: remark on defining size of basic types7James Kuyper
4 Apr 24      i`* Re: remark on defining size of basic types6Michael S
4 Apr 24      i +- Re: remark on defining size of basic types1Keith Thompson
5 Apr 24      i +* Re: remark on defining size of basic types2Janis Papanagnou
5 Apr 24      i i`- Re: remark on defining size of basic types1James Kuyper
5 Apr 24      i `* Re: remark on defining size of basic types2James Kuyper
5 Apr 24      i  `- Re: remark on defining size of basic types1Keith Thompson
5 Apr 24      `* Re: remark on defining size of basic types8Lawrence D'Oliveiro
5 Apr 24       +* Re: remark on defining size of basic types6Janis Papanagnou
5 Apr 24       i`* Re: remark on defining size of basic types5Lawrence D'Oliveiro
5 Apr 24       i `* Re: remark on defining size of basic types4Janis Papanagnou
5 Apr 24       i  `* Re: remark on defining size of basic types3Lawrence D'Oliveiro
5 Apr 24       i   `* Re: remark on defining size of basic types2Michael S
5 Apr 24       i    `- Re: remark on defining size of basic types1Keith Thompson
5 Apr 24       `- Re: remark on defining size of basic types1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal