Thread: Logarithms

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    119

    Logarithms

    I've tried looking on the net with no luck. I'm developing a small program for a pocket PC using C# MSVS 2005. I want to use the math routine log but It doesn't recognize "log" or "Log". How do I go about calculating the logarithm of a number to any base? There's got to be a routine built in for that. Thanks

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    you mean like this
    Code:
    using System;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                double x = 0.5;
    
                double y = Math.Log(x);
                Console.WriteLine(y.ToString());
            }
        }
    }
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Type casting
    By Lionmane in forum C Programming
    Replies: 28
    Last Post: 08-20-2005, 02:16 PM
  2. Mathematics (Factoring and Logarithms)
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 11-27-2004, 06:09 PM
  3. And more Mathematics (logarithms)
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 11-19-2004, 12:43 AM