comp.lang.ada
 help / color / mirror / Atom feed
* ObjectAda and Long_Long_Float
@ 2007-12-05  9:27 axtens
  2007-12-05 11:24 ` Martin Krischik
  2007-12-05 11:30 ` petter_fryklund
  0 siblings, 2 replies; 9+ messages in thread
From: axtens @ 2007-12-05  9:27 UTC (permalink / raw)


G'day everyone,

Is it the nature of the beast that ObjectAda 7.2.2 knows nothing (or
appears to) about Long_Long_Float? GNAT does.

Kind regards,
Bruce.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* ObjectAda and Long_Long_Float
@ 2007-12-05 11:15 Grein, Christoph (Fa. ESG)
  0 siblings, 0 replies; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-12-05 11:15 UTC (permalink / raw)
  To: comp.lang.ada

Float is predefined for any Ada compiler, i.e. it always exists.

Others like Long_Float etc. are optionally predefined, i.e. might not
exist on some compilers.

All these predefined types' sizes are implementation dependent.

Same with Integer, Short_Integer etc.


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05  9:27 ObjectAda and Long_Long_Float axtens
@ 2007-12-05 11:24 ` Martin Krischik
  2007-12-05 11:30 ` petter_fryklund
  1 sibling, 0 replies; 9+ messages in thread
From: Martin Krischik @ 2007-12-05 11:24 UTC (permalink / raw)


axtens schrieb:
> G'day everyone,
> 
> Is it the nature of the beast that ObjectAda 7.2.2 knows nothing (or
> appears to) about Long_Long_Float? GNAT does.

Could be. Only Float is defined the rest is optional. But why not define
your own Float type:

http://en.wikibooks.org/wiki/Ada_Programming/Types/digits

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05  9:27 ObjectAda and Long_Long_Float axtens
  2007-12-05 11:24 ` Martin Krischik
@ 2007-12-05 11:30 ` petter_fryklund
  2007-12-07  6:45   ` Simon Wright
  1 sibling, 1 reply; 9+ messages in thread
From: petter_fryklund @ 2007-12-05 11:30 UTC (permalink / raw)


On 5 Dec, 10:27, axtens <Bruce.Axt...@gmail.com> wrote:
> G'day everyone,
>
> Is it the nature of the beast that ObjectAda 7.2.2 knows nothing (or
> appears to) about Long_Long_Float? GNAT does.
>
> Kind regards,
> Bruce.

You can copy from Standard (readable by command gnatpsta) and make
your own declaration, or from here:
type Long_Long_Float is digits range -16#0.FFFF_FFFF_FFFF_F8#E+256 ..
16#0.FFFF_FFFF_FFFF_F8#E+256;

I don't know why, but this is same as Long_Float where I spend my days
(Solaris).

Regards,
Petter



^ permalink raw reply	[flat|nested] 9+ messages in thread

* ObjectAda and Long_Long_Float
@ 2007-12-05 11:39 Grein, Christoph (Fa. ESG)
  2007-12-05 13:12 ` axtens
  0 siblings, 1 reply; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-12-05 11:39 UTC (permalink / raw)
  To: comp.lang.ada

And if Float, Long_Flaot and Long_Long_Float etc. exist, there is no
requirement that they have different sizes.


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05 11:39 Grein, Christoph (Fa. ESG)
@ 2007-12-05 13:12 ` axtens
  2007-12-05 13:51   ` Georg Bauhaus
  2007-12-05 16:17   ` Adam Beneschan
  0 siblings, 2 replies; 9+ messages in thread
From: axtens @ 2007-12-05 13:12 UTC (permalink / raw)


G'day everyone,

In Dmitry Kazakov's Intervals package, he was a file,
Float_Intervals.ads which contains:

with Intervals.Floats;
package Float_Intervals is new Intervals.Floats (Float);

Today I put Long_Float in between the parentheses instead of Float,
tweaked a few things in my project and now I've got better precision.
If I want to increase the precision, what else can in put in there?
"digits 36"?

Kind regards,
Bruce.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05 13:12 ` axtens
@ 2007-12-05 13:51   ` Georg Bauhaus
  2007-12-05 16:17   ` Adam Beneschan
  1 sibling, 0 replies; 9+ messages in thread
From: Georg Bauhaus @ 2007-12-05 13:51 UTC (permalink / raw)


axtens schrieb:
> G'day everyone,
> 
> In Dmitry Kazakov's Intervals package, he was a file,
> Float_Intervals.ads which contains:
> 
> with Intervals.Floats;
> package Float_Intervals is new Intervals.Floats (Float);
> 
> Today I put Long_Float in between the parentheses instead of Float,
> tweaked a few things in my project and now I've got better precision.
> If I want to increase the precision, what else can in put in there?
> "digits 36"?
> 

You can put in a type name of any floating point type,
e.g. one that has "digits 36" in it's declaration.
The compiler you are using will tell you whether it can
support a floating point type with 36 digits.
If so, then Dmitry's generic can be instantiated with the type.

If you need to use results in another language (through a
binding), have a look at Interfaces.C; there are C_float and
related types. They should match FPT types in other languages
(that typically do not support programmer defined FPT types).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05 13:12 ` axtens
  2007-12-05 13:51   ` Georg Bauhaus
@ 2007-12-05 16:17   ` Adam Beneschan
  1 sibling, 0 replies; 9+ messages in thread
From: Adam Beneschan @ 2007-12-05 16:17 UTC (permalink / raw)


On Dec 5, 5:12 am, axtens <Bruce.Axt...@gmail.com> wrote:
> G'day everyone,
>
> In Dmitry Kazakov's Intervals package, he was a file,
> Float_Intervals.ads which contains:
>
> with Intervals.Floats;
> package Float_Intervals is new Intervals.Floats (Float);
>
> Today I put Long_Float in between the parentheses instead of Float,
> tweaked a few things in my project and now I've got better precision.
> If I want to increase the precision, what else can in put in there?
> "digits 36"?

That's going to depend on the processor.  Generally, assuming that a
processor supports floating-point instructions, then your Ada compiler
will probably support whatever floating-point formats are natively
supported by that processor---but no others.  So if a processor has
support for 32-bit and 64-bit IEEE-754 floats, most likely you'll be
able to define floating-point types that will result in one of those
two floating-point formats---but you won't be able to get a better-
precision float just by asking for a whole bunch of "digits".  (Maybe
there are Ada compilers that support higher-precision floats than the
processor supports.  I don't know.)

                                  -- Adam





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ObjectAda and Long_Long_Float
  2007-12-05 11:30 ` petter_fryklund
@ 2007-12-07  6:45   ` Simon Wright
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Wright @ 2007-12-07  6:45 UTC (permalink / raw)


petter_fryklund@hotmail.com writes:

> You can copy from Standard (readable by command gnatpsta) and make
> your own declaration, or from here:
> type Long_Long_Float is digits range -16#0.FFFF_FFFF_FFFF_F8#E+256 ..
> 16#0.FFFF_FFFF_FFFF_F8#E+256;

What's the equivalent of gnatpsta with modern GNATs?

Oh! a bit of googling -- there's a flag -gnatS which prints Standard
during a compilation. So

  gnatmake -c -u -f -gnatsS <an Ada source file>

works (I also get a warning about ALI or object file not found).

> I don't know why, but this is same as Long_Float where I spend my days
> (Solaris).

As I remember, GNAT implements Long_Long_Float in 80 bits on x86 for
Windows, as in 64 bits (same as Long_Float) on PowerPC.

Don't know what happens on Solaris (SPARC or x86).



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-12-07  6:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-05  9:27 ObjectAda and Long_Long_Float axtens
2007-12-05 11:24 ` Martin Krischik
2007-12-05 11:30 ` petter_fryklund
2007-12-07  6:45   ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2007-12-05 11:15 Grein, Christoph (Fa. ESG)
2007-12-05 11:39 Grein, Christoph (Fa. ESG)
2007-12-05 13:12 ` axtens
2007-12-05 13:51   ` Georg Bauhaus
2007-12-05 16:17   ` Adam Beneschan

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