title: NSNumberFormatter.string(from: ) maximum possible Value exceeded does not result in Overflow - Swift
body: <p>I am converting numbers to pure English words, and I ran into some very odd situations: <code>NSNumberFormatter</code> has a strange output, smaller than the desired result, but the number taken as parameter doesn't cause an overflow.</p>
  
  <p>I have the following code:</p>
  
  <pre><code> import Foundation
   var numberFormatter: NumberFormatter = NumberFormatter()
   numberFormatter.numberStyle = .spellOut
   var result: String?
   result = numberFormatter.string(from: 999999999999999999)
   print(result ?? "nil")
  </code></pre>
  
  <p>and this prints <code>eighteen quadrillion fourteen trillion three hundred ninety-eight billion five hundred nine million four hundred eighty-one thousand nine hundred eighty-four</code>, which is the equivalent of <code>18014398509481984</code>&lt; <code>999999999999999999</code>. If I try to get the words from <code>18014398509481984</code>, the result is the one I expected, the string described above. However, if I add one more <code>9</code> to  <code>999..</code>, it crashes with the message: </p>
  
  <blockquote>
    <p>integer literal <code>9999999999999999999</code> overflows when stored into <code>Int</code></p>
  </blockquote>
  
  <p>Here is a <a href="http://swiftlang.ng.bluemix.net/#/repl/58964cf63f66821add33417c" rel="nofollow noreferrer">Swift Sandbox Test</a>, in order to make the question more <em>understandable</em>.</p>
  
  <hr>
  
  <p><strong>My actual question is:</strong> Assuming that the output of the first try: <code>180140398509481984</code> is some kind of limit for <code>numberFormatter.string(from:)</code>, why does <code>999999999999999999</code> not result in Overflow, but just displays that limit, and <code>9999999999999999999</code> (with an extra 9) results in Overflow?</p>