Just now I met a funny problem with NUM2LONG macro. I've written a line like the following return NUM2LONG( fn( x ) ); Function fn has vivid side effect and NUM2LONG calls it twice ( see its definition ) :) Do not do like above!