Hi Norman,

Sorry to hear about your loss, Condolences and Best wishes from the QUANTA Committee.

Kind Regards,

John Gilpin.
QUANTA Membership Secretary.
members...@quanta.org.uk
QUANTA Treasurer
treasu...@quanta.org.uk

On 14/08/2015 21:37, Norman Dunbar wrote:
Hi Wolfgang.

Ok, thanks, it seems then that the printed and Kindle versions of Jan's book 
are incorrect for negative fp numbers. I wonder if she's taken the sign bit, 
bit 31 of the mantissa, out of consideration? Who knows!

I found a routine,  qa_lfloat with byte code 09 in the SMSQ/E sources in file 
smsq_qa_float_asm which takes the long word at TOS and floats it. I don't think 
this is present in the standard QL ROM but I haven't checked. It's certainly 
not documented. I shall knock up a small test and hopefully find someone to 
test it for me.

Sadly, I've no idea when I'll get that done as I've just been told, by my 
brother, that my mother died peacefully tonight at 19:35 so QL and Assembly 
stuff are not a priority.


Cheers,
Norm.

On 14 August 2015 19:00:50 BST, Wolfgang Lenerz<wlen...@free.fr>  wrote:
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

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to