Am 13.02.2012 12:29, schrieb Malcolm Lear:
Thanks Lee, unfortunately the maths package doesn't seem to solve the problem and I don't have access to the the Quanta library. I've just looked through my QL Today discs, but can't find anything. Maybe one of the tool kits.


On 13/02/2012 10:54, Lee Privett wrote:
I asked a similar question on the QL Forum here http://www.qlforum.co.uk/viewtopic.php?f=3&t=285

Dilwyn responded first with

"There was a Maths package by Helumt Aigner but not if it can do what you want - have a look at http://www.dilwyn.me.uk/tk/index.html. Also, have a look in Quanta Library - disk MA01 - at CalQLator which claims to do up to 120 decimal places. Author was E G Whitbread in 1985. I think program is in SuperBASIC so you might be able to look at the code to see if it does what you want. I seem to remember a QL program to calculate PI to some alarming number of decimal places such as 1900, but can't remember where I saw it - I just did a quick search on my website and Quanta library but can't seem to find it. Possibly, it might have been in Phil Jordan and Steve Johnson's PD libraries (disk 17 perhaps?)"


On 13 Feb 2012, at 10:44, Malcolm Lear wrote:

Hi,

Does anyone know if or how a 32 bit number can be printed without the scientific exponent jumping in?

Cheers
Malcolm

_______________________________________________
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

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

Malcolm,
you might want to have a look at PRINT_USING which is part of Toolkit II. You can use this to force printing in specific formats. It has, however, a bit of odd behavior when the number doesn't fit the format (it then just prints "******.**" You can do the same thing using a PROCEDURE like the following (quick and dirty) piece of code:

100 DEFine FuNction noexp$(value, digits)
110   LOCal digit, i, act$
115   DIM result$(20)
120   digit = 10^digits
130   i = 20
140   result$ = FILL$(" ", 20)
160   REPeat digiloop
170     act$ = INT((value * digit / 10 - INT (value * digit / 10)) * 10)
190     result$(i) = act$(1)
200     digit = digit / 10
220     IF digit == 1 THEN
230       i = i - 1
240       result$(i) = "."
245       i = i - 1
250     ELSE
260       i = i - 1
265     END IF
270     IF i = 0 THEN
280       EXIT digiloop
290     END IF
300   END REPeat digiloop
310   REPeat zeroloop
320     IF result$(1) = "0" AND result$(2)<> "." THEN
330       result$ = result$(2 TO)
335     ELSE
337       EXIT zeroloop
338     END IF
340   END REPeat
350   RETurn result$
360 END DEFine

You give it the value and the amount of decimal places after the comma.
(Just realized that it doesn't work for negative values).

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

Reply via email to