Sponsored Content
Top Forums Programming cos() command not working in Linux Post 302237625 by era on Thursday 18th of September 2008 03:18:13 AM
Old 09-18-2008
Correction, now I get the correct result if I change the type to double, or using cosf with float. I guess I looked at the result carelessly the first time. (Making the printf print a newline after and not before helped see what it does, too.) Sorry for any confusion.

Last edited by era; 09-18-2008 at 04:20 AM.. Reason: cosf with float, too
 

10 More Discussions You Might Find Interesting

1. Linux

FTP not working under Linux but working under any other OS ??? Very strange

Dear all, I am totally despaired and puzzled. Using Filezilla under Windows under the same network as our Linux servers is working. Using FTP command-line client under any of our Linux debian servers is not working ! I tried with different FTP servers -> same problem ! All commands are... (12 Replies)
Discussion started by: magix_ch
12 Replies

2. UNIX for Dummies Questions & Answers

sin/cos with awk

I am trying to use awk to find the trigonometric functions (in degrees) I found this on: Trigonometric functions - Rosetta Code print " sin(-30) =", sin(-30 * degrees) which says it has an output of: sin(-30) = -0.5 But when I use it I get the wrong answer: awk '{print " ... (2 Replies)
Discussion started by: cosmologist
2 Replies

3. Shell Programming and Scripting

ITcl :: try_eval command not working in Linux 5.4

Hi, My code uses try_eval block to do some code execution. This piece of code does not work on RHEL 5.4. The program just hangs at the try_eval block and does not throw any errors either. The same program however works in other Linux boxes that we have. I have written a simple program that... (0 Replies)
Discussion started by: archana485
0 Replies

4. Shell Programming and Scripting

no command is not working to send a mail in linux redhot server

HI All, I am facing the problem with rmail ... Actually my server is linux environment Redhot server. To send a mail which command I have to use it . I want subject and I want to Include CC also And body of the mail also there . But If I use rmail command it is not taking any options to... (1 Reply)
Discussion started by: ksrivani
1 Replies

5. Shell Programming and Scripting

sed command working different in linux environment.

Hi I tried running the code scrname=`whence $0 | sed -e 's/\.\///g'` where $0 is substituted by cm_dsjobrun.sh in unix env then the value it returns me is SCRNAME=/data/ds/dpr_ebicm_uat/etl/cm3_0/scripts/shell/cm_dsjobrun.sh whereas i ran the same code on linux env The value... (9 Replies)
Discussion started by: vee_789
9 Replies

6. Shell Programming and Scripting

AWK command working different in Linux

Hi All I have fired a command in linux table=`echo ${file_name} | awk '{FS="/"; print $NF}' | awk '{FS="."; print $1}'` where file_name has /data/ds/dpr_ebicm_uat/backfill/temp/etl_app_info.csv /data/ds/dpr_ebicm_uat/backfill/temp/etl_app_jobs.csv ... (10 Replies)
Discussion started by: vee_789
10 Replies

7. Red Hat

isql command not working in Linux 64bit

I am using Linux RHEL5 64 bit and installed oracle 11g. I want to check ODBC connection , i had modified odbc.ini file when i use this command -isql I am getting following error . bash: isql: command not found Kindly help (5 Replies)
Discussion started by: roopalidalvi231
5 Replies

8. UNIX for Dummies Questions & Answers

SWAP command not working on Linux machine

Hi I am working on linux machine and swap command is not working Linux Machine On Solaris machine it is working fine: uname -a SunOS rgsm01 5.9 Generic_118558-03 sun4u sparc SUNW,Sun-Fire-V440 swap -s total: 6596320k bytes allocated + 1035968k reserved = 7632288k used, 38893408k available ... (5 Replies)
Discussion started by: Basant Mishra
5 Replies

9. Shell Programming and Scripting

At command for Linux job not working from php

I have a script .sh with a curl command in it: curl --digest "http://xxxxxxx.xxx/mail.php?email=xxxx@xxx.xx"; from terminal this works good : ./script.sh //(mail arrives in my box) from php this works good: shell_exec('./phpsc.sh'); // (mail arrives in my box) from terminal this... (13 Replies)
Discussion started by: extra93
13 Replies

10. UNIX for Beginners Questions & Answers

Simple sed command not working; could be a Mac/Linux vs. PC/Linux issue

Hello, I am on a Mac and trying to clean up some monthly files with a very simple SED: sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt (from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file) then output to output.txt Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
cos(3M) 						  Mathematical Library Functions						   cos(3M)

NAME
cos, cosf, cosl - cosine function SYNOPSIS
cc [ flag... ] file... -lm [ library... ] #include <math.h> double cos(double x); float cosf(float x); long double cosl(long double x); DESCRIPTION
These functions compute the cosine of x, measured in radians. RETURN VALUES
Upon successful completion, these functions return the cosine of x. If x is NaN, NaN is returned. If x is +0, 1.0 is returned. If x is +-Inf, a domain error occurs and a NaN is returned. ERRORS
These functions will fail if: Domain Error The x argument is +-Inf. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, the invalid floating-point exception is raised. USAGE
An application wanting to check for exceptions should call feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an exception has been raised. An application should either examine the return value or check the floating point exception flags to detect exceptions. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
acos(3M), feclearexcept(3M), fetestexcept(3M), isnan(3M), math.h(3HEAD), sin(3M), tan(3M), attributes(5), standards(5) SunOS 5.10 1 Nov 20023 cos(3M)
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy