[Coco] One-liners coming through!

Robert Gault robert.gault at worldnet.att.net
Tue Jun 26 07:34:54 EDT 2007


Brian Blake wrote:
> The Vcc emulator errors out @ 81E+38. I refuse to try to convert that to a real number...
> 
> 

When I ran the program using Basic with Vcc 1.05, MESS, or a Coco, the 
overflow happened at exactly the same number 1.2712788E+38. That's just 
what should happen with good emulation because you must achieve the 
range of the floating point routines in the ROM being emulated.

Basic09 gave the same number before glitching with 1.77643598E-39. That 
is also not a surprise as a REAL number in Basic09 (5 bytes) is handled 
in the same way by ROM Basic.

Regards what these numbers mean, E stands for exponent. Since the 
numbers are decimal, overflow occurs at 1.2712788x10^38. That's ten 
raised to the 38 power or a 1 followed by 38 zeros. So there are 38 
zeros following the last 8 in the number.

What is a surprise is that Basic09 does not generate an overflow error. 
It helps to stop the Basic09 program with a trap.
  if s=i then
   stop
  endif
The above should be placed after  s=i+j




More information about the Coco mailing list