Industrial
Enviado por juan9811 • 1 de Septiembre de 2015 • Documentos de Investigación • 2.300 Palabras (10 Páginas) • 96 Visitas
/*FN****************************************************************************
*
* double Selection_Binary( int n, double value )
*
* Return: Value of function number n
*
* Purpose: This function evaluates a value according to an integer
* that identifies it.This function compare the value through 4
* sub-levels until it finds the value
*
* Time to Code: 15 Min
*
* Register of Revisions:
*
* DATE RESPONSIBLE COMMENT
* -----------------------------------------------------------------------
* Aug 18/15 Juan Sebastian Castrillón Initial implementation
*
*******************************************************************************/
double Selection_Jump(int n,/* In: Selector of a math function */
double value/* In: Operand of math function */
)
{
double result;
if(n<8)
{
if(n<4)
{
if(n<2)
{
if(n<1)
{
result=acos(value);
}
else
{
result=asin(value);
}
}
else
{
if(n<3)
{
result=atan(value);
}
else
{
result=ceil(value);
}
}
}
else
{
if(n<6)
{
if(n<5)
{
result=cos(value);
}
else
{
result=cosh(value);
}
}
else
{
if(n<7)
{
result=exp(value);
}
else
{
result=fabs(value);
}
}
}
}
else
{
if(n<12)
{
if(n<10)
{
if(n<9)
{
result=floor(value);
}
else
{
result=log(value);
}
}
else
{
if(n<11)
{
result=log10(value);
}
else
{
result=sin(value);
}
}
}
else
{
if(n<14)
{
if(n<13)
{
result=sinh(value);
}
else
{
result=sqrt(value);
}
}
else
{
if(n<15)
{
result=tan(value);
}
else
{
result=tanh(value);
}
}
}
}
return( result );
}/* Selection_Binary */
/*FN****************************************************************************
*
* double Selection_Prioritized( int n, double value );
* Return: Value of function number n
*
* Purpose: This function evaluates a value according to an integer
* that identifies it. This function compare the value with all the integers
* from low to high until it find the process to do.
*
* Time to Code: 8 Min
*
* Register of Revisions:
*
* DATE RESPONSIBLE COMMENT
* -----------------------------------------------------------------------
* Aug 18/15 Juan Sebastian Castrillón Initial implementation
*
*******************************************************************************/
double Selection_Prioritized (int n, /* In: Selector of a math function */
double value /* In: Operand of math function */
)
{
double result;
if( n==0) {
result = acos( value );
} else{
if( n==1) {
result = asin ( value );
} else{
if( n==2) {
result = atan ( value );
} else{
if( n==3) {
result = ceil ( value );
} else{
if( n==4) {
result = cos ( value );
} else{
if( n==5) {
result = cosh ( value );
} else{
if( n==6) {
result = exp ( value );
} else{
if( n==7) {
result = fabs ( value );
} else{
if( n==8) {
result = floor ( value );
} else{
if( n==9) {
result = log( value );
} else{
if( n==10) {
result = log10 ( value );
} else{
if( n==11) {
result = sin ( value );
...