Absolute value of NSInteger

后端 未结 3 713
花落未央
花落未央 2021-02-11 15:29

Referring to Convert to absolute value in Objective-C I\'m wondering if there are functions for NS typedefed types. Or is abs(NSInteger) okay? Is it architecture-sa

3条回答
  •  名媛妹妹
    2021-02-11 15:38

    Use ABS() macro, which is defined in NSObjCRuntime.h, it is architecture-safe.

提交回复
热议问题