Inf Error C
Contents |
New Topic/Question Reply 3 Replies - 3045 Views - Last Post: 07 February 2012 - 09:16 AM Rate Topic: #1 NerfherderR New D.I.C Head Reputation: 0 Posts: 2 Joined: 07-February 12 "inf" error when computing payment Posted 07 February 2012 - 09:01 AM I'm new here,
What Is Inf In C
but still a beginner in C++. Posted is the program I'm working on. Assignment: "In this assignment, what is nan in c you are to write a program that will compute a monthly payment. You are to have, at least, 1 function ( other than main() )
C Isnan
in your program." http://www.comsc.uco...se-payment.html Problem: I keep getting "inf" when I run the program. I mean, it's obvious that the main function is okay since it does ask for the input and displays something, so there must be a problem with nan in c programming the calculation function, but I'm not sure what the problem is. #include
HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Non-*NIX Forums > Programming Is solution for control "NaN" and "Inf" in C/C++ User Name
C Double Infinity
Remember Me? Password Programming This forum is for all programming questions. The question c return nan does not have to be directly related to Linux and any language is fair game. Notices Welcome to LinuxQuestions.org,
Isfinite C
a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, http://www.dreamincode.net/forums/topic/265754-inf-error-when-computing-payment/ subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or http://www.linuxquestions.org/questions/programming-9/is-solution-for-control-nan-and-inf-in-c-c-30702/ your account login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 09-19-2002, 08:24 AM #1 gmitra LQ Newbie Registered: Jun 2002 Location: Slovak Republic Distribution: RedHat, Mandrake, Gentoo Posts: 25 Rep: Is solution for control "NaN" and "Inf" in C/C++ Hi, i have very eas
get tips & solutions from a community of 418,570 IT Pros & Developers. It's quick & easy. Value of INF (double) P: n/a Rob.Meyer1 I'm working on a class for working with fractions and one of https://bytes.com/topic/c/answers/164806-value-inf-double the public functions is to return the decimal value of the fraction which is simple enough except for when the denominator is 0. I don't want to return 0.0 because thats not what it is, I would rather return https://studiofreya.com/cpp/how-to-check-for-nan-inf-ind-in-c/ NaN or INF but I can't figure out how to do that. Does anyone know the expression for either of these in doubles? Or even the bit pattern that represents INF and/or NaN? I can't seem to find it posted in c anywhere. double Fraction::Decimal() const{ if (IsValid()) return double(n) / d; else return ???; } //n is numerator, d is denominator, of course. ??? is the expression I need to figure out. Sep 27 '05 #1 Post Reply Share this Question 6 Replies P: n/a Pete Becker Ro********@gmail.com wrote: I would rather return NaN or INF but I can't figure out how to do that. They mean very different things. But unless you're talking about 0.0/0.0. the correct value is inf in c infinity, not NaN. Does anyone know the expression for either of these in doubles? numeric_limits
scoped_ptr vs unique_ptr Boost::format (and wformat) examples - numbers: int, float, double Boost::format string examples Say goodbye to memory leaks in C++ with Boost! 1.#INF, 1.#IND and #QNAN floating point numbers and errors C++ casts C++ Concepts Building GCC with Concepts Lite Hello concepts C++ Concepts: New keywords Function and variable concepts The nine types of constraints Conjunctions and Disjunctions Predicate and expression constraints Type and implicit conversion constraints Argument deduction constraints Exception constraints Parameterized constraints Your own concepts Getting started with arithmetic concepts C++ std::sort predicate with templates C++ variadic template example C++ variadic templates Class templates in C++ Function templates in C++ GLSL inn i C++ How to check for NAN / INF / IND in C++ How to handle circular dependencies with templates in C++ Performance testing in C++ Remove item from an std::vector Simple threading with std::async std::remove_if with lambda explained Template metaprogramming Templates on the surface C# .NET Build folder explorer with c# .Net How to make Twitter auto follow/unfollow program in Visual Studio with C# .NET Game making Bullet Physics Bullet Physics: How to change body mass Custom needsCollision on raycasts in Bullet Physics Debug triangles in Bullet Physics Explosion with Bullet Physics From Irrlicht mesh to Bullet Physics mesh Visualizing quaternions - proper rotation with Bullet Physics CEGUI tutorial: Cyrillic Russian fonts Irrlicht culling problem Mechanics behind a game engine Most difficult thing in videogame development Video game animation Java How to use Java varargs Inheritance Java equality check Java conversions and 7 Golden rules of widening, boxing & varargs Java parallel streams API Java test with JUnit Java volatile vs atomic variables Recipe for a high-quality "equals" method Synchronize session beans and filter XPath - how to create a custom rule XPath examples - Hibernate java mapping XPath examples - WebService OpenGL GLSL shaders: black dots Introduction - Robot Arm Introduction - Space cube Simple Light Triplanar terrain texturing with GLSL Physics and Math Advanced Sphere-Sphere Continuous Collision Detection (CCD) Basic primitives Collision detection in practice Collision theory Distance from point to plane implementation Simple AABB vs AABB collision detection Simple Sphere-Sphere Collision Det