Seite 1 von 1

If IsInfinity(Double) ist wahr obwohl IsInfinity(Double) = 0

Verfasst: 21.01.2018 20:51
von STARGÅTE
Hallo Leute,

irgendwie ergibt das gerade kein sinn für mich.
Unter x86 ergibt IsInfinity(Double) im If-Statement ein #True, obwohl es "danach" normal 0.0 anzeigt.

Code: Alles auswählen

Define Double.d = 2.0e40

Debug Double
If IsInfinity(Double)
	Debug "IsInfinity = True"
Else
	Debug "IsInfinity = False"
EndIf
Debug IsInfinity(Double)

Re: If IsInfinity(Double) ist wahr obwohl IsInfinity(Double)

Verfasst: 21.01.2018 21:08
von mk-soft
Unterschiedliches Anzeige bei Window und Mac

Win 7 Pro (x64)
Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
20000000000000001000000000000000000000000.0
IsInfinity = False
0.0
macOS 10.13.2 (x64)
[20:08:05] Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
[20:08:05] 20000000000000000607572056854007333781504.0
[20:08:05] IsInfinity = False
[20:08:05] 0.0
P.S.
macOS 10.13.2 (x86)
[20:11:56] Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
[20:11:56] 20000000000000000607572056854007333781504.0
[20:11:56] IsInfinity = True
[20:11:56] 0.0
Ich glaube es ist ein Auto-Cast Fehler unter x86

Code: Alles auswählen

Define Double.d = 2.0e40
Debug CPUName()
Debug Double
If 0.0+IsInfinity(Double)
   Debug "IsInfinity = True"
Else
   Debug "IsInfinity = False"
EndIf
Debug IsInfinity(Double)