Code trouble


 
Thread Tools Search this Thread
Top Forums Programming Code trouble
# 1  
Old 01-15-2018
Wrench Code trouble

I have a formula for figuring out relitive humidity but it will not compile the trouble is the double **
Code:
es= 6.11 * 10.0**(7.5*tc/(237.7+tc))

how do I enter in gcc format...??
thanks
Eldon

Last edited by vbe; 01-15-2018 at 01:10 PM.. Reason: code tags...
# 2  
Old 01-15-2018
Assuming you mean C, and
according to this article it should be

Code:
#include <math.h>

es= 6.11 * pow( 10.0, (7.5*tc/(237.7+tc)) );

Also consult the man page
Code:
man pow

This User Gave Thanks to MadeInGermany For This Post:
# 3  
Old 01-15-2018
tried that

/home/eldon/wthrbase/src/wthrbase.c:929:15: error: too few arguments to function ‘pow'
this is the error
# 4  
Old 01-15-2018
You probably didn't put enough options into pow. Please show the exact code you used.
# 5  
Old 01-15-2018
es = 6.11 * pow(10.0 * (7.5 * c/ (237.7 + c)));

thanks
# 6  
Old 01-15-2018
Quote:
Originally Posted by eldondehart
es = 6.11 * pow(10.0 * (7.5 * c/ (237.7 + c)));

thanks
Change:
Code:
es = 6.11 * pow(10.0 *  (7.5 * c/ (237.7 + c)));

to:
Code:
es = 6.11 * pow(10.0, (7.5 * c/ (237.7 + c)));

or:
Code:
es = 6.11 * pow(10.0, 7.5 * c/ (237.7 + c));

This User Gave Thanks to Don Cragun For This Post:
# 7  
Old 01-15-2018
that did it!!!!! thanks lots all of you.
Eldon
These 2 Users Gave Thanks to eldondehart For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Trouble with backup

At work I am running a solaris 10 server with a ZFS filesystem. I am unfortunately not a solaris expert by any stretch of the imagination, and the relative difficulty in doing what I consider to be a super basic operation using solaris is driving me insane. It is my job to figure out some way... (2 Replies)
Discussion started by: dreiak
2 Replies

2. Shell Programming and Scripting

Trouble executing piped shell commands in perl code

I am trying to execute a piped combination of shell commands inside a perl program. However, it is not working as desired. This is my program, i am trying to print only filenames from the output of ls -l $ cat list_test #!/usr/bin/perl -w use strict; my $count=0; my @list=`ls -l|awk... (4 Replies)
Discussion started by: sam05121988
4 Replies

3. Shell Programming and Scripting

while condition with trouble

Hello! i have a llittle missunderstanding with a script and maybe you can explain where is the mistake. in the first place a have this script that is working just fine ... read -p "enter the name of the instance: " instance while ; .... but if i change the second condition with -z "`grep... (2 Replies)
Discussion started by: doro
2 Replies

4. Programming

Trouble with C

Hey, i am having a problem First, i know java well and i have used C++ on occasion so i thought i would be able to deal with a class where they program in C. unfortunately i have hit some speed bumps that i am having problems. Here is my problem: I have a structure cache_t in the sample... (0 Replies)
Discussion started by: zephoid
0 Replies

5. UNIX for Dummies Questions & Answers

Little Trouble Understanding some code...

Couple of questions as I try to decipher someones code who left... What would something coded like this do? IFS=: grep FIELD1 /Path/Path2/Param.fle | read LBL1 LBL2 USRID EADR SUBJ SERVERNAME CFGTBL DIR ERR=0 Param.fle contents.. FIELD1:FEI::FIELD2:dATAFIELD BATCH:MAIN SERVER......etc.. (2 Replies)
Discussion started by: NycUnxer
2 Replies

6. UNIX for Dummies Questions & Answers

X trouble

Hi there, I'm new to unix-environments. I'm richard, and i'm mostly a web-developer, under php. I've done work in unix env before, but never had my own. Today, I've got debian 3.1 r4 from the official site, and i've attempted to install it twice. I installed it initially as "Desktop... (0 Replies)
Discussion started by: izua
0 Replies

7. Solaris

Trouble with tr

I'm not sure where to post this but it's happening on a SunOS 5.8 server so I'll try here. I've discovered some unexpected behavior when using tr. For example: echo a | tr Z echo b | tr a echo a | tr B echo a | tr B echo a | tr A (8 Replies)
Discussion started by: Mike@Work
8 Replies

8. UNIX for Dummies Questions & Answers

The trouble about SU ...

Hi all, having read lots of posts about SU I don't quiet understand this : I'm doing regular backups of my database (u betta do) and therefore use su - username -c "sqlscript special data_base" in a unixscript which is even using cron. (yep!) Now I need some other script, still with this... (4 Replies)
Discussion started by: nulnul7
4 Replies

9. What is on Your Mind?

The trouble with...

Welcome to "The trouble with...." with your host, ZazzyBob. Todays offering - "The trouble with letting other people host your website" I use a certain web hosting service, who shall of course remain nameless here. They are running PHP 4.3.10 I decide to write a script to test their PHP... (6 Replies)
Discussion started by: zazzybob
6 Replies

10. UNIX Desktop Questions & Answers

trouble

Hello, The system reboots in single user mode what command to use to bring the system up regularly?? I get INIT: cannot create /var/adm/utmpx Type control -d to proceede with a normal startup or give root passwd for system maintaince. either way i don't have a change and ... (1 Reply)
Discussion started by: awk
1 Replies
Login or Register to Ask a Question