Differences between revisions 2 and 3
Revision 2 as of 2010-05-24 20:02:06
Size: 600
Editor: gtang
Comment:
Revision 3 as of 2010-05-26 14:16:55
Size: 431
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
When you use a float numbers in EMAN2, use it explicitly. That means add a 'f' postfix if you mean a float. For example,
use: 
When you use a float numbers in EMAN2, use it explicitly. That means add a 'f' postfix if you mean a float. For example,  use:
Line 8: Line 8:
Line 12: Line 13:

Otherwise it may cause error on windows platform.
Because the number without postfix by default is double type.
And the double to float conversion returns zero on VC++.

Even if you do not use float numbers in a Dict, i
t's still better to explicitly specifies the number as float explicitly to
save a implicitly type conversion from double to float.
Because the number without postfix by default is double type. It's better to explicitly specifies the number as float explicitly to save a implicitly type conversion from double to float.

When you use a float numbers in EMAN2, use it explicitly. That means add a 'f' postfix if you mean a float. For example, use:

Dict params;
params["alt"] = 360.0f;

instead of:

Dict params;
params["alt"] = 360.0;

Because the number without postfix by default is double type. It's better to explicitly specifies the number as float explicitly to save a implicitly type conversion from double to float.

eman2FloatNumbers (last edited 2010-05-26 14:16:55 by gtang)