Abdulla
Abdulla

Reputation: 1127

C# Ln to Mathf.Log

How would you go about writing this function in C#?

enter image description here

I know this has to do with Mathf.Log, but my math is a little rusty. Any help would be great.

Upvotes: 4

Views: 15119

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1500525

Mathf looks like it's for Unity. Unless you're using Unity, you probably want:

double x = 1 + (Math.log(v -s) / (10 * Math.log(2)));

Upvotes: 8

Related Questions