MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / lo0bits

Function lo0bits

strings/dtoa.c:864–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862
863
864static int lo0bits(ULong *y)
865{
866 register int k;
867 register ULong x= *y;
868
869 if (x & 7)
870 {
871 if (x & 1)
872 return 0;
873 if (x & 2)
874 {
875 *y= x >> 1;
876 return 1;
877 }
878 *y= x >> 2;
879 return 2;
880 }
881 k= 0;
882 if (!(x & 0xffff))
883 {
884 k= 16;
885 x>>= 16;
886 }
887 if (!(x & 0xff))
888 {
889 k+= 8;
890 x>>= 8;
891 }
892 if (!(x & 0xf))
893 {
894 k+= 4;
895 x>>= 4;
896 }
897 if (!(x & 0x3))
898 {
899 k+= 2;
900 x>>= 2;
901 }
902 if (!(x & 1))
903 {
904 k++;
905 x>>= 1;
906 if (!x)
907 return 32;
908 }
909 *y= x;
910 return k;
911}
912
913
914/* Convert integer to Bigint number */

Callers 1

d2bFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected