package body math_lib is -- function which returns the square root of a floating point number function sqrt(A : float) return float is guess, delt : float; begin if a = 0.0 then return 0.0; elsif a = 1.0 then return 1.0; else guess := a / 2.0; delt := 1.0; while guess ** 2 > a loop guess := guess / 2.0; end loop; while abs(guess ** 2 - a) > 0.0001 loop while (guess + delt) ** 2 > a loop if delt < 1.0e-6 then return guess; end if; delt := delt / 2.0; end loop; guess := guess + delt; end loop; return guess; end if; end sqrt; -- function which returns the natural log of a floating point number. function ln(a : float) return float is x1 : float