This might be a very dumb question, but if I have a CGFloat with value of 44.0, how do I make it to -44.0? I tried doing -myFloat and 0 - myFloat but it gives me 0. Why is this? Also I don't want a multiply by -1 answer
Its very simple dude. Just multiply it with -1.
i.e. 44.0 * -1 = -44.0
Update:
Solution 2 as mentioned by Inafziger
yourNo = 0 - yourNo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With