OpenCores
URL https://opencores.org/ocsvn/1664/1664/trunk

Subversion Repositories 1664

[/] [1664/] [trunk/] [c/] [lista/] [n8_trova__asende_n8.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mrdmkg
#include "tipodef.h"
2
 
3
n8 n8_trova__asende_n8(n8 *cadena, n8 cuantia, n8 indise, n8 sinia)
4
{
5
 
6
 if(cuantia!=0)
7
 {
8
 
9
  if((cuantia&1)==1)
10
  {
11
 
12
   if((cadena[--cuantia])==sinia)
13
   {
14
    return cuantia;
15
   }
16
  }
17
 
18
  while((cadena[(indise+1)<<1]<=sinia)&&(indise<cuantia)) {indise=(indise+1)<<1;}
19
 
20
  for(;indise<cuantia;indise++)
21
  {
22
 
23
   if (cadena[indise]>=sinia)
24
   {
25
    break;
26
   }
27
  }
28
 }
29
 
30
 return indise;
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.