In Haskell you can use Data.Real.Constructible (<a href="http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;constructible" rel="nofollow">http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;constructible</a>) to compute exactly with arbitrary square roots.