Home  |  Forums  |  914 Info  |  Blogs
 
914World.com - The fastest growing online 914 community!
 
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG. This site is not affiliated with Porsche in any way.
Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners.
 

Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> Who speaks C?, printf("I'm stuck/n");
fiid
post Jan 23 2006, 10:52 AM
Post #21


Turbo Megasquirted Subaru Member
****

Group: Members
Posts: 2,827
Joined: 7-April 03
From: San Francisco, CA
Member No.: 530
Region Association: Northern California



I think you need to use printf("%f\n"... instead of %d. %d is for various integer types.

I would also stick to using lower case for variable names (actually in C - I think convention is to use lower case for EVERYTHING except #define statements. You can use camelCase for varible names: example: incrementCounter.

You can do a ton of formatting conversions on the $d - i.e. if you only want 5 decimal places you can do %.5d

It's also possible to get scientific notation out of it. If you're on a unix box try "man 3 printf" and it will describe it all for you.


User is offlineProfile CardPM
Go to the top of the page
+Quote Post
MattR
post Jan 23 2006, 12:11 PM
Post #22


Advanced Member
****

Group: Members
Posts: 3,279
Joined: 23-January 04
From: SF Bay Area
Member No.: 1,589
Region Association: Northern California



Okay guys,

Ive fixed a BUNCH of the problems you've pointed out. I also spoke with my professor this morning and he pointed out the bounds of integration. I was taking the square root of a negative number because my upper bound was 1+2/n. I'm going to fix it tonight after work.

Thanks so much!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

2 Pages V < 1 2
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th May 2024 - 03:14 PM