Path: utzoo!utgpu!watmath!clyde!att!rutgers!uwvax!geowhiz!jct
From: jct@geowhiz.UUCP (John C. Terranova)
Newsgroups: comp.sys.mac.programmer
Subject: Re: LSC Debugger
Summary: float vs int
Keywords: debugger data window floating point
Message-ID: <962@geowhiz.UUCP>
Date: 2 Dec 88 23:57:45 GMT
References: <2088@uokmax.UUCP>
Reply-To: jct@geowhiz.UUCP (John C. Terranova)
Organization: University of Wisconsin, Department of Geology and Geophysics
Lines: 37

In article <2088@uokmax.UUCP> rob@uokmax.UUCP (Robert K Shull) writes:
>Suppose I have the following program:
>#include 
>main()
>{
>	float	a;
>	int	b;
>	
>	a = 1;
>	for(b=0;b<100;b++)
>		a+=1;
>	printf("a=%d\n",a);
>}
>
>With the program "stepped" to the line "a+=1;", I switch to the data window
>and try to change the value of a, which I've been monitoring. I can set
>the value of a to 0, but not to anything else.
>If I go back to LSC, change the type of a to "int" and re-run the debugger,
>I can change the value of a with no problem.

You will notice that 1 is not the same as 1.0.  1 is an integer and
1.0 is a float.  With this in mind, did you try to assign 1.0 to the
float variable or just 1?  The debugger is really not a compiler (I
think) and may not be able to typecast numbers for us.

If you tried 1.0 and it didn't work then it sounds like the debugger
is broken.

------------------------------------------------------------------------------
John Terranova     |  What the hell do I know? | I'm not a Computer Science
   CS, BS to be    |  I come from Waunakee!    | undergraduate, but I play
-------------------+---------------------------+ one at school.
ARPA:   jct%geowhiz.uucp@spool.cs.wisc.edu     +------------------------------
BITNET: jct%geowhiz.uucp%spool.cs.wisc.edu@vms3.macc.wisc.edu
------------------------------------------------------------------------------
I once believed in causes, too.  And had my pointless point of view.
    --Billy Joel, "Angry Young Man"