Skip to content
Snippets Groups Projects
  1. Mar 15, 2012
    • Iustin Pop's avatar
      Rework unit parsing · 1cdcf8f3
      Iustin Pop authored
      
      Due to how conversions were implemented previously, 1TB failed to
      parse on 32-bit, as we were overflowing during computation, even
      though the final result would fit easily.
      
      This patch moves the parsing of the scaling factor to a separate
      function, and all the conversions are done via the Rational type
      (which has unlimited arbitrary precision), and conversion to the
      desired type only happens at the last step.
      
      The unit-tests are adjusted too, unfortunately they use the same
      algorithm as the code… suggestions on how to improve things are
      welcome.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      1cdcf8f3
  2. Mar 14, 2012
  3. Mar 13, 2012
  4. Mar 09, 2012
  5. Mar 07, 2012
Loading