search

Home  >  Q&A  >  body text

ios - Is there a more precise type than double in Swift? Why does the double type not display scientific notation if the value is too large?

If the double type value is too large, it will be displayed in scientific notation, for example, 5.6846032206862e 19

Using the double type when multiplying tens digits by tens digits may lead to inaccurate calculations. How to solve this problem? .

大家讲道理大家讲道理2722 days ago1388

reply all(1)I'll reply

  • 某草草

    某草草2017-06-06 09:55:56

    First of all, you need to understand how double calculates precision. Secondly, if it exceeds the maximum precision of double, it is usually displayed with a string. If you need to multiply large numbers, search for a lot of algorithms for multiplying large numbers;

    reply
    0
  • Cancelreply