Example of NaN? (20-6)

0 views
Skip to first unread message

Chris Wasden

unread,
Dec 2, 2011, 6:41:08 PM12/2/11
to byu-cs-jm-142-Fall-2011
Could we have an example of how an NaN works in C++? I don't recall
using NaN in any program or seeing it used in class...

Jay McCarthy

unread,
Dec 2, 2011, 6:53:04 PM12/2/11
to byu-cs-jm-1...@googlegroups.com
It is not a number. You can just write "NAN" in your program or do something like "sqrt(-1)" to get it


On Fri, Dec 2, 2011 at 4:41 PM, Chris Wasden <christoph...@gmail.com> wrote:
Could we have an example of how an NaN works in C++? I don't recall
using NaN in any program or seeing it used in class...



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

dorme

unread,
Dec 3, 2011, 9:51:45 AM12/3/11
to byu-cs-jm-142-Fall-2011
Can we see an example of NAN in code?

On Dec 2, 4:53 pm, Jay McCarthy <jay.mccar...@gmail.com> wrote:
> It is not a number. You can just write "NAN" in your program or do
> something like "sqrt(-1)" to get it
>
> On Fri, Dec 2, 2011 at 4:41 PM, Chris Wasden

> <christopher.was...@gmail.com>wrote:


>
> > Could we have an example of how an NaN works in C++? I don't recall
> > using NaN in any program or seeing it used in class...
>
> --
> Jay McCarthy <j...@cs.byu.edu>

> Assistant Professor / Brigham Young Universityhttp://faculty.cs.byu.edu/~jay

Jay McCarthy

unread,
Dec 3, 2011, 10:07:15 AM12/3/11
to byu-cs-jm-1...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages