POP_REAL

Previous  Next

 

POP_REAL( real-value )

 


 

Retrieves a REAL parameter.  If not present, an error will be signalled.

 

Example

 

/////////////////////////////////////////////////////////////////////////////

// real = SAMPLE.ATAN( p1 )

// real = SAMPLE.ATAN( p1, p2 )

//

int _Sample_atan( mb_interpreter_t* s, void** l )

{

  float fAtan = 0;

 

  BEGIN_PARSE( s, l )

     POP_REAL( p1 )

     OPT_REAL( p2, 0 )

  END_PARSE

 

  if ( SKIPPED_LAST )

  {

     // Use atan( x )

 

     fAtan = float( atan( p1 ) );

  }

  else

  {

     // Use atan( y, x )

 

     fAtan = float( atan2( p1, p2 ) );

  }

 

  RETURN_REAL( fAtan );

}