Search code examples
mathreact-nativeformulalogarithm

How to include logarithm function in calculation?


I am using react-native to build my mobile app and one of the feature include using a formula to calculate a result.

The formula includes log function as seen below:

enter image description here

How can I include log function into my calculation code?


Solution

  • Using the Math.log() method.

    (459 / (1.0324- (0.19077 * (Math.log((abdomen-neck) + (0.15456 * Math.log(height) )))))) - 450
    

    It would make sense to save each of the brackets into a variable and compute more clearly