Re: New proposal for math.e

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:

> Derek Parnell wrote:
> 
> > constant RADIANS_DEGREES = 57.29577951308232158
> > constant DEGREES_RADIANS = 0.017453292519943296
> 
> I think:
> 
> constant RADIANS_TO_DEGREES = 180/PI
> constant DEGREES_TO_RADIANS = PI/180
> 
> is more in keeping with the Eu philosophy.

And the list of global constants then would look like this:
global constant
   LN2        = log(2),
   LN10       = log(10),
E          = machine_func(47, {105,87,20,139,10,191,5,64}),    --
   2.7182818284590452e0
   SQRT2      = sqrt(2),
   HALF_SQRT2 = SQRT2/2
PI         = machine_func(47, {24,45,68,84,251,33,9,64}),      --
   3.1415926535897932e0
   HALF_PI    = PI/2
   QUARTER_PI = PI/4
   TWO_PI     = PI*2

I like it. The calculation of the constant values is only done once at
initialization of the program, so the time for it is negligible, no?

Regards,
   Juergen

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu