CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: logarithmic operation

  1. #1
    Join Date
    May 2015
    Posts
    326

    logarithmic operation

    Hi,

    I have the following function:

    Code:
    double nanoSecDbToMicroSec(unsigned char nsDb)
    {
    	return (pow(10.0, 0.1 * nsDb) )* 0.001;	
    }
    when the input is : 200
    The output is : -2049400832

    looks wrong ?

    Any inputs /corrections is very helpful

    thanks a lot
    Pdk

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,718

    Re: logarithmic operation

    It looks like you are using a C style printf format to look at the value.
    Probably "%d" .. which is for integers ... use "%e"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)