Specifying precision in vector<mpf_class>?
Niels Möller
nisse@lysator.liu.se
18 Aug 2003 12:46:15 +0200
gerardo.ballabio@unimib.it (Ballabio Gerardo - Dip. di Scienza dei Materiali) writes:
> On 2003.08.15 17:25, Niels Möller wrote:
> > It might make sense to let the template parameter only specify a
> > *default* precision for the instances, and still allow the actual
> > precision to be changed at runtime.
>
> So that an mpf_class<64> might NOT have a precision of 64? That looks
> somewhat perverse to me.
Well, that's a question of taste, of course.
Both actual precision and default precision make sense as compile-time
parameters (i.e. C++ template parameters). Both also make some sense
as run-time parameters, but in my opinion, it is more sane to change
the actual precision of particular variables at run-time, than to
change a global default precision at run-time. I guess that's because
I generally dislike global library variables.
Regards,
/Niels