title: What's the logic of clamp function in dart?
body: <p>Numeric classes like int, double, num has clamp function. I try it and have some results.. I guess it has a logic like </p>
  
  <pre><code>a = math.max(-1, math.min(1, a));
  </code></pre>
  
  <p>but when I print this code I have the strange result</p>
  
  <pre><code>print(-100.43.clamp(-400.2, 64.2)); // -64.2
  </code></pre>
  
  <p>What's the algorithm of dart's clamp function?</p>