[Haskell-cafe] Re: pi
Isaac Dupree
isaacdupree at charter.net
Wed Oct 10 14:19:36 EDT 2007
David Roundy wrote:
> On Wed, Oct 10, 2007 at 12:29:07PM +0200, jerzy.karczmarczuk at info.unicaen.fr wrote:
>> ChrisK writes:
>>> There are two things in Floating, the power function (**) [ and sqrt ]
>>> and the transcendental functions (trig functions,exp and log, and
>>> constant pi).
>>>
>>> Floating could be spit into two classes, one for the power and one for the
>>> transcendental functions.
>> The power is an abomination for a mathematician. With rational exponent it
>> may generate algebraic numbers, with any real - transcendental... The
>> splitting should be more aggressive. It would be good to have *integer*
>> powers, whose existence is subsumed by the multiplicative s.group structure.
>> But the Haskell standard insists that the exponent must belong to the same
>> type as the base...
>
> I suppose you're unfamiliar with the (^) operator, which does what you
> describe?
and (^^) which allows even negative integer exponents (at the price of
requiring it to be possible to take the reciprocal of the base type)
Isaac
More information about the Haskell-Cafe
mailing list