473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

NAN option for gcc?

Alright I give up! I thought that to only option I need for NAN,
nan(), nanf(), etc. is -l (after all you use #include <math.h>). But
NO ...

It works with g++. What -l option is required?

Thanks ahead of time,
John

PS> Yes, I've grepped the (infinite) man for gcc.

Nov 14 '05 #1
7 6210
Correction:

"... I thought that the only option I need for NAN,
nan(), nanf(), etc. is -lm (after all you use #include <math.h>)."

Nov 14 '05 #2
jc**********@gmail.com wrote:
Alright I give up! I thought that to only option I need for NAN,
nan(), nanf(), etc. is -l (after all you use #include <math.h>). But
NO ...

It works with g++. What -l option is required?


I don't think nan() or nanf() is standard

maybe you'd have better luck with something like
atod("NaN")

?
-Mysid

Nov 14 '05 #3
Actually nanf("") works; although nanf(NULL) gives a seg. fault. BUT
both compile using gcc -lm, whereas NAN does not. But NAN works with
g++ (no option). What am I getting by using g++ that I'm not getting
with gcc -lm?

---John

Nov 14 '05 #4
"James Hess" <my*****@gmail.com> writes:
jc**********@gmail.com wrote:
Alright I give up! I thought that to only option I need for NAN,
nan(), nanf(), etc. is -l (after all you use #include <math.h>). But
NO ...

It works with g++. What -l option is required?


I don't think nan() or nanf() is standard


They're both in C99.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 14 '05 #5
jc**********@gmail.com wrote:
Alright I give up! I thought that to only option I need for NAN,
nan(), nanf(), etc. is -l (after all you use #include <math.h>). But
NO ...

It works with g++. What -l option is required?

Thanks ahead of time,
John

PS> Yes, I've grepped the (infinite) man for gcc.


Did you use C99 or gnu99 standard (-std=c99/gnu99, of course together
with -lm)?
AFAIR, these are no C89 standard library functions.
This may make a difference w.r.t. what is available from the standard
library (apart from the usual gcc argument that the library is not
their part).
Note that this is not entirely topical in comp.lang.c.
gcc specific questions are usually better asked in gcc.gnu.help.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #6
Yep, that worked: gcc -lm -std=c99. Thanks much!

---John

PS> Next time I'll direct gcc questions to gcc.gnu.help.

Nov 14 '05 #7
jc**********@gmail.com wrote:
Yep, that worked: gcc -lm -std=c99. Thanks much!
You are welcome. Just as an aside: -lm belongs _after_ the compile
functions, see
<m3************@amoeba.parasoft.com>
(This is a message ID, you can use it to find the message, e.g.
with groups.google.com)

---John

PS> Next time I'll direct gcc questions to gcc.gnu.help.


Okay. One thing: Please quote a minimum of the message you are
referring to so that everyone sees the context. Otherwise, people
may see only your reply for some hours or days or forever without
having the least clue what you are responding to. See CB Falconer's
signature if you are using google for your newsgroup participation.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Targa | last post by:
I have a select box with about 5 options. I need to have one of the options, when selected, display a second select box. The second select box is populated by a database and needs to be preloaded...
3
by: gekoblu | last post by:
Hi!, I want to fix via javascript the combo width to a fix value. I'd like to implement a kind of ALT / TITLE function to show the entire option when the text is longer than the combo width......
3
by: Rithish Saralaya | last post by:
Is there a way to scroll a selected OPTION into view? I have a combination of text box and SELECT list. A user can key in text in the text box, and depending on the entry made, the respective...
4
by: Fluffy Convict | last post by:
I have found a workaround to disable certain options in an option list: var p = document.forms.elements; p.selectedIndex=-1; This works perfectly in IE - the selectedIndex becomes unclickable....
3
by: Iain Hallam | last post by:
Hi. I've been using display:none on the style property of some <option> elements in my forms, which works fine with Mozilla - as expected it removes the option from my dropdown (although it...
3
by: Stewart | last post by:
Dear comp.lang.javascript, I have more than once wanted to manipulate the contents of select boxes dynamically, whilst the boxes contain <optgroup> tags. Manipulation of a select box containing...
8
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript">...
3
by: ANTISPAM_garycnew_ANTISPAM | last post by:
What is the simplest way to retain the last option value selected in an html select object using javascript? I am currently using a server-side cgi language to accomplish this task, but it adds...
2
by: rpeterson84 | last post by:
Hi, Thanks in advance to for the help!!!!! When the page loads, "Application Inventory" is selected by default --- I want to use a mouse.click to select "Systems Compliance", BUT HOW? I'm...
3
by: Venturini | last post by:
I am trying to put together a web page where the customer makes choices of products and is then given a total. I am extremely new to Javascript and have managed to get as far as I have from web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.