title: How to use leading_zeros/trailing_zeros in platform independent way?
body: <p>I want find the first non-zero bit in the binary representation of a  <code>u32</code>. <code>leading_zeros</code>/<code>trailing_zeros</code> looks like what I want:</p>
  
  <pre><code>let x: u32 = 0b01000;
  println!("{}", x.trailing_zeros());
  </code></pre>
  
  <p>This prints <strong>3</strong> as expected and described in <a href="https://doc.rust-lang.org/std/primitive.u32.html#method.trailing_zeros" rel="nofollow noreferrer">the docs</a>. What will happen on big-endian machines, will it be <strong>3</strong> or some other number?</p>
  
  <p>The documentation says </p>
  
  <blockquote>
    <p>Returns the number of trailing zeros in the binary representation</p>
  </blockquote>
  
  <p>is it related to machine binary representation (so the result of <code>trailing_zeros</code> depends on architecture) or base-2 numeral system (so result will be always <strong>3</strong>)?</p>