Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-10-2002, 12:25 PM   #1 (permalink)
brtklt
Registered User
 
Join Date: Jul 2002
Location: Dallas, TX
Posts: 2
brtklt is on a distinguished road
Send a message via Yahoo to brtklt
problems w/ c++ pow() function

Ignore this. I had the values in the function reversed.

I'm having trouble w/ pow() where it won't return the correct value. For instance, the following code works:

double i = 4;
double j;
j = pow(2,i);
(j now holds 16)

The following code returns 2.09715e+06

double i = 21;
double j;
j = pow(2,i);
(j now holds 2.09715e+06

Even using the fixed and showpoint operaters I get a value that's way off from 441 (what j should hold if I'm not mistaken). I've tried using float and long double data types as well.
brtklt is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
operate overloading member function in C# sureshkumar_kc MS Technologies ( ASP, VB, C#, .NET ) 2 10-15-2004 02:36 AM
C# member function sureshkumar_kc MS Technologies ( ASP, VB, C#, .NET ) 2 10-15-2004 02:08 AM
edit? anon Lounge 10 11-21-2002 03:02 PM


All times are GMT -8. The time now is 05:07 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting