mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-09-07 12:54:31 +00:00
Slight adjustment to FPSTR_FLEX formatting
This commit is contained in:
parent
177c621364
commit
f4ce23a3cf
Binary file not shown.
@ -233,15 +233,15 @@ export def ext2str(ext, str, intdigits, fracdigits, format)
|
|||||||
//
|
//
|
||||||
// Underflow
|
// Underflow
|
||||||
//
|
//
|
||||||
dp = -fracdigits
|
dp = -fracdigits - 1
|
||||||
fin
|
fin
|
||||||
fin
|
fin
|
||||||
if format & FPSTR_FLEX and (dp <= -fracdigits or dp >= (format & FPSTR_FIXED ?? intdigits :: numdigits))
|
if format & FPSTR_FLEX and (dp < -fracdigits or dp > (format & FPSTR_FIXED ?? intdigits :: numdigits))
|
||||||
//
|
//
|
||||||
// Print as exponent if over/underflow fixed digits
|
// Print as exponent if over/underflow fixed digits
|
||||||
//
|
//
|
||||||
if numdigits < 8; numdigits = 8; fin
|
if numdigits < 7; numdigits = 7; fin
|
||||||
return ext2str(ext, str, 1, numdigits - 8, FPSTR_EXP | (format & FPSTR_STRIP))
|
return ext2str(ext, str, 1, numdigits - 7, FPSTR_EXP | (format & FPSTR_STRIP))
|
||||||
fin
|
fin
|
||||||
//
|
//
|
||||||
// Convert as floating point
|
// Convert as floating point
|
||||||
|
@ -4,7 +4,7 @@ include "inc/fpstr.plh"
|
|||||||
|
|
||||||
var xT[t_extended]
|
var xT[t_extended]
|
||||||
char sT[32] // extra space
|
char sT[32] // extra space
|
||||||
byte str = "123456789.123456789E+80"
|
byte str = "123456789.123456789"
|
||||||
byte i
|
byte i
|
||||||
|
|
||||||
// mul div
|
// mul div
|
||||||
@ -19,7 +19,7 @@ def test(iM, iD)#0
|
|||||||
puti(iM); putc('/'); puti(iD)
|
puti(iM); putc('/'); puti(iD)
|
||||||
if iD<10; putc(' '); fin
|
if iD<10; putc(' '); fin
|
||||||
puts("=>")
|
puts("=>")
|
||||||
ext2str(@xT,@sT,6,9,FPSTR_FLEX|FPSTR_FIXED) // fixed
|
ext2str(@xT,@sT,9,9,FPSTR_FLEX|FPSTR_FIXED) // fixed
|
||||||
puts(@sT); putc('[')
|
puts(@sT); putc('[')
|
||||||
puti( sT); putc(']')
|
puti( sT); putc(']')
|
||||||
putln
|
putln
|
||||||
|
@ -1299,7 +1299,8 @@ end
|
|||||||
def parse_module#0
|
def parse_module#0
|
||||||
init_idglobal
|
init_idglobal
|
||||||
init_idlocal
|
init_idlocal
|
||||||
puts("Data+Code buffer size = "); puti(codebufsz); putln
|
puts("Data+Code buffer size = "); puti(codebufsz); putln; putln
|
||||||
|
puts(@relfile);
|
||||||
if nextln
|
if nextln
|
||||||
//
|
//
|
||||||
// Compile module
|
// Compile module
|
||||||
@ -1310,7 +1311,7 @@ def parse_module#0
|
|||||||
emit_codeseg
|
emit_codeseg
|
||||||
puti(codeptr - codebuff); puts(@bytesln)
|
puti(codeptr - codebuff); puts(@bytesln)
|
||||||
while parse_defs; nextln; loop
|
while parse_defs; nextln; loop
|
||||||
puts("INIT:")
|
puts("INIT:");
|
||||||
entrypoint = codeptr
|
entrypoint = codeptr
|
||||||
prevstmnt = 0
|
prevstmnt = 0
|
||||||
init_idlocal
|
init_idlocal
|
||||||
|
Loading…
Reference in New Issue
Block a user