Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-05-17 06:52:20


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Daniel Frey
| Sent: 15 May 2005 23:21
| To: boost_at_[hidden]
| Subject: [boost] Re: Math constants - updated.
|
| Paul A Bristow wrote:
| > | rationale.html. cubeRootFour is called two_pow_two_thirds in the
| > | documentation.
| >
| > Sorry I have not updated this much after the discussion
| during review.
| > I'll do some tidying up - thanks for noting this.
|
| Another typo: sqrt32 is commented as sqrt(10) in the source.

Thanks - corrected in my version and will upload some time.
|
| And a question: Sometimes, you omit the trailing 0(s) from some
| constants. Could you change the scripts to not do this? I
| could make use
| of it, the current version of my library (not yet published)
| includes a
| "port" of your constants, that is also capable of retrieving the
| original value (that is, the string in the source!) and pass it on to
| generic mappers to initialize e.g. RWDecimal<RWMP3Int> or other types
| with a ctor taking const char*. Having the trailing zeros would make a
| better statement about the real value-range it represents. Example:
|
| 1.23 specifies a number from the range [1.225-1.235)
|
| while
|
| 1.230 specifies a number from the range [1.2295-1.2305)
|
| and thus the latter yields more information.

Not easily, I fear, as NTL's RR type does NOT provide all the formatting
like double.
I'll look into this - ask the author - but I fear not.

| BTW: In case you don't like me to port your header, let me know. Of
| course, credit will be given if you don't have any objections.

You are welcome to the values - they are hardly secret or novel -
But CONVENIENT and ACCURATE (I hope!)

Paul

PS Oh and don't forget the final desiderata for Boost "Doing The Right
Thing"
- handling smallest intervals,
(floating-point format dependent) for example:

pi float, radix = 2, digits = 24
pi is 3.141592653589793238462643383279502884197169400753 to 50 decimal
digits.
float pi to 9 significant digits 3.14159265

static const float v_l = 13176794.0f/(1 << 22); // One representation.
static const float v_u = 13176795.0f/(1 << 22);

static const float pi_l = 3.141592502593994140625F; // Exactly
representables.
static const float pi_u = 3.1415927410125732421875F;

pi double, radix = 2, digits = 53
pi is 3.141592653589793238462643383279502884197169400753 to 50 decimal
digits.
double pi to 17 significant digits 3.1415926535897932

static const double v_l = 7074237752028440.0f/(1 << 51)
static const double v_u = 7074237752028441.0f/(1 << 51);

static const double pi_l =
3.141592653589793115997963468544185161590576171875; // Exactly
representables.
static const double pi_u =
3.141592653589793560087173318606801331043243408203125;

Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
mailto: pbristow_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk