[Ql-Users] Arithmetic precision

2011-05-10 Thread Dilwyn Jones
Does anyone know of any routines for the QL which can handle double 
precision floating point maths?


When asked, all I could think of was Helmut AInger's math toolkit, but 
I haven't looked at it yet.


Alternatively, if anyone knows how to write such a routine (a BASIC 
demo would do) or has a sample listing showing how to achieve this I'd 
be very grateful.


At this stage, accuracy is more important than speed.

Dilwyn Jones 




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


Re: [Ql-Users] Arithmetic precision

2011-05-10 Thread Dave Walker
Dilwyn,

Writing such routines from scratch is likely to be a non-trivial task!

The c68 library has a whole set of support routines written in assembler for
this purpose that conform to the IEEE standard for Double Precision floating
point.   I suspect it would not be that hard to put some Basic keywords at
the front-end of them to make them accessible from SuperBasic.   They have
the advantage that they have been put through a formal test suite to check
that they give the correct answers which might be important?

If you could give an indication of how you expect to use them then I could
have a quick look to see if I think the c68 routines could be adapted to
that purpose.  It would be nice to know what operations you want to carry
out if it is more than simply arithmetic operations. Possibly important is
how you expect to load up and extract the values without losing precision.

Of course if you wanted to use them from C then they are ready to go - you
just need to use the 'long double' data type.

Dave Walker

Tel:  +44 (0)1707 652791
Mob: +44 (0)7999 218953
Web: http://www.itimpi.com
Skype:  itimpi

 -Original Message-
 From: ql-users-boun...@lists.q-v-d.com [mailto:ql-users-
 boun...@lists.q-v-d.com] On Behalf Of Dilwyn Jones
 Sent: 10 May 2011 18:14
 To: ql-users@lists.q-v-d.com
 Subject: [Ql-Users] Arithmetic precision
 
 Does anyone know of any routines for the QL which can handle double
 precision floating point maths?
 
 When asked, all I could think of was Helmut AInger's math toolkit, but
 I haven't looked at it yet.
 
 Alternatively, if anyone knows how to write such a routine (a BASIC
 demo would do) or has a sample listing showing how to achieve this I'd
 be very grateful.
 
 At this stage, accuracy is more important than speed.
 
 Dilwyn Jones
 
 
 
 ___
 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


Re: [Ql-Users] Arithmetic precision

2011-05-10 Thread Dilwyn Jones

Dave Walker wrote:

Dilwyn,

Writing such routines from scratch is likely to be a non-trivial 
task!


The c68 library has a whole set of support routines written in
assembler for this purpose that conform to the IEEE standard for
Double Precision floating point.   I suspect it would not be that
hard to put some Basic keywords at the front-end of them to make 
them

accessible from SuperBasic.   They have the advantage that they have
been put through a formal test suite to check that they give the
correct answers which might be important?

If you could give an indication of how you expect to use them then I
could have a quick look to see if I think the c68 routines could be
adapted to that purpose.  It would be nice to know what operations
you want to carry out if it is more than simply arithmetic
operations. Possibly important is how you expect to load up and
extract the values without losing precision.

Of course if you wanted to use them from C then they are ready to go
- you just need to use the 'long double' data type.

Dave Walker
I have been trying to help Steve Poole with a program he is writing. I 
do not fully understand the need for such routines, although he has 
tried to explain (without much success!) what he is trying to achieve.


The routines would need to be usable from BASIC, perhaps as BASIC 
extensions.


Never having looked at anything like this, I simply didn't know what 
it would involve. Hence my request for information.


Dilwyn Jones 




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


[Ql-Users] Where is SBASIC?

2011-05-10 Thread Martyn Hill

Dear list

I am working on an SBASIC editing tool (initially in SBASIC itself) 
under SMSQ/E (QPC 2).


I'm currently trying to find my way around the SBASIC (Job0 or 
otherwise) job area and am confused by the locations of the various 
areas within the SBASIC job itself.


Here's an example from a fairly long SBASIC daughter job (sorry about 
the possibly screwed-up spacing):


AreaLength  St   End

Input buf   10 256   266
Token buf61280  1286
Program  23830  123544147374
Name table2856   89800 92656
Name list 2889   59848 62737
Variables 4080-3110136  -3106056
Channels   200 -179720   -179520
Return  24 -790456   -790432
Lines0   0 0

How is it that some of these areas lie well outside of the traditional 
SBASIC job area?


I have my own ideas, but hoped someone here (Marcel?) might be able to 
shed some light on how and where SBASIC is laid-out in SMSQ/E.


Also, the Job 0 pointed-to from the system variables appears to be a 
'dummy' job header+job area (640 bytes, regardless of whats loaded in 
Job 0).


I supoose all I really need to know (beyond satisfying my curiosity) is:

a) Can I rely on the pointers above - from peek_l(\\...) - to find 
the actual table data?
b) Is there a SBASIC job-size stored in any _one_ place (as opposed 
to adding up the 'Length' bits above)


Thanks for any insights ;-)

Martyn Hill
London.

--
There are 10 types of people in this world. Those who understand binary and those 
who don't.

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