If there really is a need for these extra precision routines to be available from SB, then maybe it would be worth writing SB wrappers for the maths support routines used by c68? These include support for IEEE 32,64 and 80 bit, and also for 64 bit integers with add/subtract/multiply/divide supported as arithmetic operators. They are highly optimised assembler, so should not be that difficult to wrap? In fact if there is a real need, I could do it (on the basis that I already support these routines).
The hardest part will be to get agreement on the SB interface needed to support what is wanted. Dave ----- Original Message ----- From: "P Witte" <[EMAIL PROTECTED]> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Sent: Friday, March 14, 2003 12:11 AM Subject: Re: [ql-users] Sbasic and numbers > > François Van Emelen writes: > > > Thank you for your 'ADD$' function, but it doesn't solve my problem. > > I'll rephrase my question with a concrete example: > > A DBAS-file is open. One of the fields is of type 3 (floating point) > > The user wants to update that field. > > That could be done with something like: > > 120 input new_value$ > > Suppose the value assigned to new_value$ exceeds 9 digits > > (new_value$='12345678.55') or another value with more than 9 digits > > As long as '12345678.55' is manipulated with a text variable everything > > will be ok, of course. > > But that large number has to be stuffed into the floating point field. > > set#channel, x,new_value$ , x=field number > > New_value$ is 'save' to the floating point field in its internal format > > (I suppose) > > Let us now (or later on, of course) retrieve the content of that field: > > a=fetch(#channel,x): 'a$' could be used instead of 'a' > > print a (or a$) will display '1.234568E7' which is not the same as the > > value assigned to new_value$. > > > > And here comes my original question again: > > > > Is there a way to get the original value.In other words is it possible > > to act upon 'a' (or 'a$') to 'extract' '12345678.55' from '1.234568E7' > ? > > Use a string variable in DBAS instead of a float and use the sort of > routines I described to do the calculations. > > Didnt someone write an IEEE fp (64 or 80 bit) emulation package for the QL? > Even if there is one, youd probably have to store the values in a string > unless DBAS happens to support the type. > > Per > > >
