Discussion forums
[C#] Function ln(x) in C#
You have to be logged in to reply
Author | Message |
---|---|
brainstormer
Member |
Posted on 06/01/2021 at 14:24:03
Hi!Do you know what is the function that I have to use in C# to calculate ln(x)? I saw that there are Log and Log10 but there is no ln function. |
TheLibrarian
**Moderator** |
Posted on 06/01/2021 at 19:21:04
Hello brainstormer!If you want to calculate ln(x) (natural logarithm) in C#, you have to use the function Log from the Math class: Math.Log(x) But don't forget to add the namespace System using System; The function Math.Log10 exists as well and allows to calculate the logarithm with base 10. -------------------------- |
brainstormer
Member |
Posted on 07/01/2021 at 20:57:19
Thank you for these precisions.It works fine! |
You have to be logged in to reply
Share this page on social media: