P
PeteUK
Hello,
I'm writing a system where I want to specify at the core via a typedef
what floating point precision I need e.g.
typedef float FPType;
or
typedef double FPType;
Other types will be based upon this, so vector and matrix classes will
take FPType as a template parameter to generate a vector/matrix of the
correct precision.
I'm left with the problem of how to initialise FPType data from a
literal. Example:
float f = 45.0f; // 'f' suffix for float
double d = 45.0; // no suffix for double
Is there a way I can abstract this away too?
Thanks,
Pete
I'm writing a system where I want to specify at the core via a typedef
what floating point precision I need e.g.
typedef float FPType;
or
typedef double FPType;
Other types will be based upon this, so vector and matrix classes will
take FPType as a template parameter to generate a vector/matrix of the
correct precision.
I'm left with the problem of how to initialise FPType data from a
literal. Example:
float f = 45.0f; // 'f' suffix for float
double d = 45.0; // no suffix for double
Is there a way I can abstract this away too?
Thanks,
Pete