Adding large Power values in Xcode

前端 未结 2 1668
南旧
南旧 2021-01-28 14:33

I am new to Objective C and iPhone development.

I\'m working with a basic calculator. I want to add a large value in text field. How can I display large values like this

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 15:10

    You could set up a NSNumberFormatter with NSNumberFormatterScientificStyle and call stringFromNumber... However, the issue I think is going to be with the precision you are hoping to support requires a specialized framework. There might be one based on GNU MP Bignum library out there, but I don't know it off hand.

提交回复
热议问题