Macros: precision of variables when passed to run-commands

Posted by Herbie on
URL: http://imagej.273.s1.nabble.com/Hyperstack-with-nz-1-problem-tp5019980p5020101.html

Dear experts,

presently and to my knowledge there are 4 ways to pass a variable to a
macro run-command.

E.g. in case of image normalization one could write

getRawStatistics( N, mn, mi, mx );

// 1.
if ( mx != 0 ) run( "Divide...", "value=&mx" );

// 2.
if ( mx != 0 ) run( "Divide...", "value=[mx]" );

// 3.
if ( mx != 0 ) run( "Divide...", "value=" + d2s( mx, 9 ) );

// 4.
if ( mx != 0 ) run( "Divide...", "value=" + mx );

 From my investigation, #1. to #3. give the same and best precision and
#4. does not. The fact that #4. is depreciated is known since long and
#3. was recommended instead. However, the newer techniques #1. and #2.
have not yet been specified with respect to precision and that's why I ask:

Do #1. to #3. behave equally with respect to numerical precision?

Best regards

Herbie

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html