Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
D notation bug
#3
bplus, see what you get from the following
Code: (Select All)

Declare Library
    Function snprintf& (Dest As String, Byval l As Long, frmt As String, Byval x As Double)
End Declare

Screen _NewImage(768, 768, 32)
_ScreenMove 0, 0

Cls
Locate 3, 1:

Color &HFF00FFFF~&&
Locate , 1: Print "c#";
Locate , 25: Print "c# + 1";
Print
Print

Color &HFFFF8000~&&
Print "c# = ... :": Color &HFFFFFFFF~&&
c# = 10#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 10000000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 100000000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
c# = 1000000000000000000000000000000#: Locate , 1: Print strf(c#);: Locate , 25: Print strf(c# + 1)
Print
Print

Function strf$ (x As Double)
    Dim As String s
    Dim As String frmt
    Dim As Long l, ex, sign
    sign = Sgn(x)
    If sign < 0 Then x = -x
    s = Spc(64)
    frmt = "%.16g" + Chr$(0)
    l = snprintf(s, Len(s), frmt, x)
    s = _Trim$(s)
    If InStr(s, ".") > 0 And Left$(s, 1) = "0" Then s = Mid$(s, 2)
    If sign < 0 Then s = "-" + s Else s = " " + s
    ex = InStr(s, "e")
    If ex > 0 Then Mid$(s, ex, 1) = "F"
    strf = s
End Function
Reply


Messages In This Thread
D notation bug - by bplus - 07-09-2023, 05:00 PM
RE: D notation bug - by Jack - 07-09-2023, 05:53 PM
RE: D notation bug - by Jack - 07-09-2023, 06:10 PM
RE: D notation bug - by mnrvovrfc - 07-09-2023, 06:32 PM
RE: D notation bug - by mnrvovrfc - 07-14-2023, 09:53 PM
RE: D notation bug - by DSMan195276 - 07-09-2023, 06:39 PM
RE: D notation bug - by SMcNeill - 07-09-2023, 07:03 PM
RE: D notation bug - by bplus - 07-09-2023, 07:27 PM
RE: D notation bug - by Jack - 07-09-2023, 10:40 PM
RE: D notation bug - by bplus - 07-10-2023, 12:42 AM
RE: D notation bug - by Jack - 07-10-2023, 01:12 AM
RE: D notation bug - by bplus - 07-10-2023, 02:19 AM
RE: D notation bug - by bplus - 08-26-2023, 02:36 PM
RE: D notation bug - by Jack - 08-26-2023, 05:12 PM



Users browsing this thread: 1 Guest(s)