-- eccezioni.ada -- Giosia Poma By GPPROGRAM -- -- with Text_IO, Float_Text_IO, Float_Math_Lib; use Text_IO, FLoat_Text_IO, Float_Math_Lib; procedure Eccezioni is x : FLOAT; function Cota(x : FLOAT) return FLOAT is begin return cos(x)/sin(x); exception when CONSTRAINT_ERROR => if (sin(x) >= 0.0 and cos(x) >= 0.0) or (sin(x) < 0.0 and cos(x) < 0.0) then return FLOAT'LAST; else return -FLOAT'LAST; end if; end Cota; begin Put_Line("Introdurre x:"); Get(x); Put_Line("La tangente di x vale: "); Put(cota(x),5,3,0); end eccezioni;