views:

28

answers:

1

Hi, it's very common in Ada to create a derived type say a new Float type with the last element being Float'Last. I have not yet seen someone using Float'Safe_Large instead of the attribute Float'Last when defining a new Float type. On my 32-bit machine, both

Put( Float'Image( Float'Last ));

and

Put( Float'Image( Float'Safe_large ));

return me the value 3.402..E38

I would like to know the difference between these two number attributes and perhaps also why 'Safe_Large is not as commonly used as the attribute 'Last.

Thanks a lot...

+2  A: 

Presently, the Last attribute is defined for any scalar subtype. Now obsolete, Safe_Large is available in GNAT as an implementation defined attribute for compatibility with Ada 83. The Ada 95 Rationale offers some insights about the change in the discussion on "Safe Range".

trashgod
Thanks. I'll stick to 'Last.
yCalleecharan