[Haskell-cafe] pi

Dan Piponi dpiponi at gmail.com
Tue Oct 9 18:43:47 EDT 2007


On 10/9/07, jerzy.karczmarczuk at info.unicaen.fr
<jerzy.karczmarczuk at info.unicaen.fr> wrote:
> So, you assume that acos should have a *default* implementation in the
> Floating class? Propose it, please.

I don't think the proposal makes any such assumption. It implies only
that *if* you provide acos, pi will be provided for you automatically
if you want.

> Note, BTW that from the viewpoint of "actual" correctness, it would be
> better to have PI as exact as possible, while acos, well, it is a trans-
> cendental function, whose representations are usually approximate...

pi is a transcendental number, same argument applies.

I wouldn't want pi defined in terms of a transcendental function
because people often use the Num type class to represent things that
aren't actually numbers, eg. power series or ASTs for an embedded
language. The reusability of Num varies inversely with how many
assumptions you make about it.
--
Dan


More information about the Haskell-Cafe mailing list