Burge Kurt wrote: > Hi, > > What is the usage of div_t in python? > > I have some unsigned integer variables and want to use ; > > div_t div_T; > div_t div_N; > div_t div_B;
I guess this is more C code. It doesn't have any Python equivalent - Python doesn't declare variables and doesn't have unsigned integers. You might be interested in the divmod() function: >>> help(divmod) Help on built-in function divmod in module __builtin__: divmod(...) divmod(x, y) -> (div, mod) Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x. >>> divmod(10, 3) (3, 1) You will in general get a better response from this list if you tell us what problem you are trying to solve, rather than showing brief snippets of C. Even better is to attempt a solution in Python and let us see where you get stuck. Have you read any of the tutorials I pointed out? Programming Python is quite different from C and you should try to get the flavor of it. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor