Now it should be easy, but how can two NSNumber
submit? As is:
[a float value] + [two float value]
or better exists?
is not really a better way, but you really should not do it if you escape from it You can. Scalar numbers are present in the form of a cover for the NSNumber
so that you can store them in the archive and pass them polymorphically with the other NSObjects
. They are not really used to store numbers in actual mathematics if you do math on them, then it is only too slow to perform operations on scalers, which is probably not a convenience method. For example:
NSNumber * yoga = [with NSNumber number explosion: ([a float value] + [two float value]];
On messaging, at least 21 instructions are being executed, and although a lot of code is taken to unbox the method and the price for a command value of mathematics (maybe a few hundred ) Again.
So if you need to store the numbers in decorts, use NSNumber
, if you need to do something that does not have any number or string If so, then NSNumber
, but if you want to make math stick with scalar C type.
Comments
Post a Comment