[comp.sys.cbm] C Power 128 query

prindle@nadc (05/15/87)

From: prindle@NADC


Has any user of "C Power 128" been able to obtain the fix to the "floating
point to integer conversion problem"?  Supposedly, it has been fixed by the
author, but I just can't seem to locate the fix (I believe it would be in
library function "conv52" or "cnvfi").  Briefly, the problem is:

	main()
		{
		int i;
		float f;

		f=123.4;
		i=(int)f;		/*the (int) is optional in this case*/
		printf("i=%d\n",i);	/*should print 123*/
		}

prints garbage for "i"!  I wrote to the company describing this and many other
bugs in "C Power 128".  All other significant bugs were fixed and the repaired
files posted to the C Power BBS.  Not so the fix to the bug above.  Any
clues?

Sincerely,
Frank Prindle
Prindle@NADDBprogr

dean@hyper.UUCP (Dean Gahlon) (05/18/87)

in article <1861@rutgers.rutgers.edu], prindle@nadc says:
] 
] Has any user of "C Power 128" been able to obtain the fix to the "floating
] point to integer conversion problem"?  Supposedly, it has been fixed by the
] author, but I just can't seem to locate the fix (I believe it would be in
] library function "conv52" or "cnvfi").  Briefly, the problem is:
] 
] 	main()
] 		{
] 		int i;
] 		float f;
] 
] 		f=123.4;
] 		i=(int)f;		/*the (int) is optional in this case*/
] 		printf("i=%d\n",i);	/*should print 123*/
] 		}
] 
] prints garbage for "i"!  I wrote to the company describing this and many other
] bugs in "C Power 128".  All other significant bugs were fixed and the repaired
] files posted to the C Power BBS.  Not so the fix to the bug above.  Any
] clues?
	I've come up with a partial fix for this problem, but there seem to be
other problems with floating point. (The partial fix was to call the correct
BASIC ROM routine -- the routine which the existing libraries call does NOT
leave its result in the A and Y registers (even though its name in Commodore
documentation leads one to believe this), and the code in the library expects
it to do so. )
	On another note, does anybody out there know about what C-power 128's
problem with regard to scanf/fscanf/sscanf of hex numbers is? It doesn't seem
to work right, yet I've looked at the library code, and can't seem to find
anything wrong.


						Dean C. Gahlon
						...ihnp4!umn-cs!hyper!dean