Search code examples
iphoneobjective-clogarithm

How do I calculate a logarithm in iOS?


I want to calculate a logarithm in iOS. Can Objective-C do this?


Solution

  • You can use the C functions for calculating logarithms

    #import <math.h>
    double myLog = log(10);
    

    You can also see here: What kind of logarithm functions / methods are available in objective-c / cocoa-touch?