comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Ada.Numerics.Long_Real_Arrays
Date: Fri, 27 Jan 2017 18:39:48 +0000
Date: 2017-01-27T18:39:48+00:00	[thread overview]
Message-ID: <lyh94kuz2j.fsf@pushface.org> (raw)
In-Reply-To: 85df173c-35e9-4e2e-b067-459794a98aa8@googlegroups.com

hnptz@yahoo.de writes:

> with Ada.Text_Io; use Ada.Text_Io; 
> with Nm_G; 
> procedure Nm_Test is 
>    package Nm is new Nm_G (Rows => 3); 
>    use Nm; 
>    P : R_Matrix := ((42.0, 42.0), (43.0, 43.0), (44.0, 44.0)); 
>    V,X  : R_Vector := P (P'Last);
>    MLF : Long_Float := 6.0; 
> begin 
>    Put_Line ("v: " & V (V'First)'Img & ", " & V (V'Last)'Img); 
>    X := V / MLF;
>    Put_Line ("X: " & X (X'First)'Img & ", " & X(X'Last)'Img); 
> end Nm_Test; 
>
> It should also work according to the description in the ARM 2012.
> However, it says: expected type "Standard.Long_Float"

This is because I declared Nm_G.R_Vector as a subtype; the required
operation "/" of Ada.Numerics.Long_Real_Arrays.Real_Vector isn't
visible.

You could modify your Nm_Test to

   use type Ada.Numerics.Long_Real_Arrays.Real_Vector;

but the best approach (I think): declare Nm_G.R_Vector as a type,

   type R_Vector
   is new Ada.Numerics.Long_Real_Arrays.Real_Vector (1 .. Np);

      reply	other threads:[~2017-01-27 18:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 12:25 Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 13:50 ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-25 14:11 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 16:17   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-25 18:35 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 21:29 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-26  7:47   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26 11:54     ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-26 14:52       ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26 15:03         ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26  7:49   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26  7:55     ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-27 16:51 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-27 18:39   ` Simon Wright [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox