> On 14 Aug 2015, at 17:56, Norman Dunbar <nor...@dunbar-it.co.uk 
> <mailto:nor...@dunbar-it.co.uk>> wrote:
> 
> 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?

Yes. (An amended version) Put the fp number onto the arithmetic stack and use 
RI.EXECB to do the following:

qa.dup.qa.nlint,qa.float,qa_sub,0

This duplicates the number, finds the nearest long integer to the first copy 
and then converts that long integer to floating point whereupon it finds the 
difference between the converted number and the original.

This assumes that the internal from of the fp number is normalised. That is 
that bit 30 of the mantissa is 1 or that the number is very small indeed.

George


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

Reply via email to