Path: utzoo!mnetor!uunet!husc6!linus!necntc!ames!umd5!uvaarpa!virginia!psy3b2.psyc.Virginia.EDU!jap7g From: jap7g@psy3b2.psyc.Virginia.EDU (Jim A. Pisano) Newsgroups: comp.lang.c Subject: MATH Error in MSC 5.0 Message-ID: <737@virginia.acc.virginia.edu> Date: 6 Apr 88 13:55:35 GMT Sender: acc@virginia.acc.virginia.edu Reply-To: jap7g@psy3b2.psyc.Virginia.EDU (Jim A. Pisano) Followup-To: jap7g@psy3b2.psyc.Virginia.EDU (Jim A. Pisano) Organization: Psychology Department, University of Va. Lines: 28 Keywords: MSC, Math, Run-time, error I've written a simple keyboard-timing program in Microsoft C Ver. 5.0 which records when a keypress is made & the elapsed time between keypresses in a given time period. I use the function 'ftime()' to get hours, minutes, seconds, & milliseconds. These times are then converted to decimal hours (I use doubles). Here's the problem: The program runs fine, i.e. it calculates all of the times & elapsed times correctly for the given time period, prints out the results, & displays the message: run-time error M6101: MATH - floating-point error: invalid The manual says that error M6101 results when an invalid operation occured. This usually involves operating on a NAN (Not A Number) or infinity. It exits at that point with exit code 127. I've used Codeview without success on the routine that uses floating point math & Codeview says that the program terminates normally with exit code 127. Here are my questions: Can someone recognize this problem? Where could it be coming from? I have an 80287-equiped AT & have looked at the 80287 registers with the '7' command, but I don't know enough about the 80287 to debug my problem. Please reply by e-mail, as I don't read comp.lang.c regularly. Thanks in advance, Jim Pisano