Logarithms

This is a discussion on Logarithms within the C# Programming forums, part of the General Programming Boards category; I've tried looking on the net with no luck. I'm developing a small program for a pocket PC using C# ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,452
    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());
            }
        }
    }
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 05:09 PM
  3. And more Mathematics (logarithms)
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 11-18-2004, 11:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21