> >100 CLS
> >120 d=DATE(2001,6,11,0,0,0)
> >140 PRINT d
> >160 d1=1.2762214E9
> >180 PRINT DATE$(d)
> >200 PRINT DATE$(d1)
> >
> >d1 is the value returned by d (line 140)
> >Why doesn't line 200 return the same date as line 180?
> >...sometimes they aren't (and then the difference seems to be
> >6m40s). Where have those 6m40s gone and why?
> >
> >Any idea?

As I replied in relation to trying to solve a TRA problem: The QL uses a
31+sign bit Mantissa which means that, as integers can ALWAYS be
specified exactly in any base (with enough digits), the QL will hold
integer values accurately to 2^31-1 or 2.17483647E9 = 217,483,647
(tested on my Classic JM) - it's just the display routines that only
convert this to 7 significant figures.

In the above program, I added line 150 on my QL:

150 PRINT d-1.276e9

which then caused the output:

1.276214e9
214400
2001 Jun 11 00:00:00
2001 Jun 10 23:53:20

Now, it you consider the first two lines of output together, it means
the TRUE value of d is: 1.276e9 + 214400, or 1.276214400e9, whereas in
line 160 you've supplied a value of 1.276214000e9, some 400 seconds (or
6 min, 40 seconds) less than the true value.

Robert

Reply via email to