Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2008 by Ivor Horton; ISBN: 9780470225905
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2010, 06:23 PM
Registered User
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch. 6 Calculator division question

I have complied the calculator and all the exercise at the end of the chapter and they work better than i expected. I was think bout putting some code in to prevent division by zero, however when i tried divinging by zero in the original code, it already gives output of 1. INF . I can't figure out at all where it is getting this output and why this program is able to deal with division by zero based on the code already contained. Any help or ideas would be greatly appreciated.
 
Old March 26th, 2010, 02:51 PM
Authorized User
 
Join Date: Feb 2010
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Lightbulb partial explanation

Here is a partial possible explanation.

MS VC++ uses IEEE 754 floating point number representation. That representation scheme includes unique encodings of +INF and -INF. (See http://www.psc.edu/general/software/.../ieee/ieee.php .) The run-time library and print code in MS VC++ is such that if a computation result is +INF or -INF, and the result is to be displayed by print code, the result is displayed as such: +INF or -INF, or something that represents those.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Division by zero Corey BOOK: Beginning Access 2003 VBA 2 April 13th, 2007 02:56 PM
Ch 2 example 2-5 question Bo BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 August 16th, 2006 07:44 AM
new ch. 6 question Dennis Mollet BOOK: Beginning VB.NET Databases 2 August 16th, 2005 05:27 PM
division by zero rickjg JSP Basics 1 November 9th, 2004 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.