separate ( Generic_Elementary_Functions ) function Infinity (X : Float_Type) return Float_Type is -- This function formally delivers an infinite result with the same -- sign as X. It is called during argument prescreening in some of -- the elementary functions when the argument is such that the result -- MUST overflow. This function will cause an overflow to occur, -- except when executed in an environment implementing the proposed -- IEEE binding for Ada, in which case it will deliver an IEEE infinity -- with the correct sign. It is carefully constructed to avoid some -- compiler bugs that have been observed, in which a CONSTANT expression -- that must overflow is incorrectly handled by the compiler at compile -- time. Big : constant Common_Float := Common_Float'Base'Last; Signed_Big : constant Common_Float := Common_Float(Copy_Sign(1.0, X)) * Big; begin return Float_Type((Signed_Big * Big) * Big); end;