Autor: Arndt Lindner (---.dip0.t-ipconnect.de)
Datum: 04.10.18 15:15
Beim Zugriff auf Gleitkommazahlen in Strukturen, die einen bestimmten Wert überschreiten, stürzt das Programm ab (XProfanX4) oder hängt sich in einer toten Schleife auf (XProfanX3). Man kann das ganze zwar umgehen (siehe Codebeispiel), das ist aber nicht im Sinne der Verwendung von Strukturen.
struct teststruct = a!,b!
declare memory testbereich : dim testbereich,teststruct
declare double x,y
cls
x = 9223372036854774780.000000
float testbereich,0 = x
y = float(testbereich,0)
logout "T1 "+str$(x)+" "+str$(y)
print "T1",x,y
x = x + 511.0
float testbereich,0 = x
y = float(testbereich,0)
logout "T2 "+str$(x)+" "+str$(y)
print "T2",x,y
x = x + 512.0
float testbereich,0 = x
y = float(testbereich,0)
print "T3",x,y
print
' Mit Fehler
x = 9223372036854774780.000000
testbereich.a! = x
y = testbereich.a!
logout "T1 "+str$(x)+" "+str$(y)
print "T1",x,y
x = x + 511.0
testbereich.a! = x
y = testbereich.a!
logout "T2 "+str$(x)+" "+str$(y)
print "T2",x,y
x = x + 512.0
testbereich.a! = x
y = testbereich.a!
print "T3",x,y
dispose testbereich
waitinput
end
Kann man da Abhilfe schaffen?
|
|