jrv@Mitre-Bedford (01/11/85)
I have discovered three bugs in DeSmet C version 2.3... 1. A double constant may not have more than 19 significant digits. I'm not asking for arbitrary-precision arithmetic, but pi=3.141592653589793238462 shouldn't generate a syntax error. 2. For this code: double alpha() { if(1) return 1.; else return 2.;} int beta(){} the compiler reports "error:must return float" at the beginning of the *last* line. There are really three problems here. a. The compiler isn't smart enough to see that a double really is being returned for every execution path. b. The compiler refers to "float" rather than "double". c. The error message is in the wrong place. The easy fix would be to have the compiler generate the non-fatal message "warning:above function may not alway return double" 3. The DeSmet C library program can't calculate the sine of any angle between 0 and .2118609476670 when an 80287 is used. (The program prints "*Square root of a negative number*" and dies. On an IBM AT, a cntrl-alt-del reset is needed to recover.) Numbers outside that range work OK, tan() and cos() work OK, and sin() works OK if the 80287 isn't used. The same programs work okay on Z-100s with 8087s. I've heard that a new version of DeSmet C has been released which fixes a bug in the 80287 math routines. This may be the bug they found. - Jim Van Zandt