Hi,
(...)
My own experimenting with poke_float and peek_float from DJToolkit 1.15
show different values for the negatives:
-1 is 0800 80000000
The values read back correctly - poke_float addr, -1 followed by print
peek_float(addr) does indeed give -1.
I don't know about Jones' book, but 0800 80000000 certainly is the value
given in the QDOS reference manual for -1.
Second question, is there a simple way to look at the internal
representation of a float and determine whether it is an INT or not?
So if I got 2.7 and 2.0 as two parameters, is it easy to tell that the
second is an INT while the first is not. Looking at the internal
representation, I don't think it is.
No, I don't believe it is.
There are some useful conversion routines in the maths package, but I
don;t see a way, easily, to INT() a floating point value and leave that
INT value on the maths stack as a floating point. I need to NLINT it to
a long word INT instead and then mess about re-stacking that as a float
instead - this cannot surely be how it is done?
Surely, the interpreter doesn't have to go through those hoops whever it
sees something like:
2500 IF INT(x) = x THEN do_somthing: END IF
Does it?
Perhaps not.
I don't really know how it is done, bu I'd convert both to long ints and
see whether they're equal.
Have a look at the smsqe sources ....smsq_qa_int_asm
Wolfgang
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm