Author Topic: [dev build] $DEBUG Scientific notation *** ultra low priority ***  (Read 2437 times)

0 Members and 1 Guest are viewing this topic.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
[dev build] $DEBUG Scientific notation *** ultra low priority ***
« on: September 29, 2021, 01:27:42 am »
@FellippeHeitor

v2.0  049499c   Win 10x64 Pro  21H1 (Aug update)


Some issues regarding scientific notation - notes as part of output


Note that precision is not an issue (depends on the number of bits per variable type).



Code: QB64: [Select]
  1. $DEBUG
  2. dev$ = "v2.0  049499c Win10 x64 Pro 21H1 build (Aug updated)"
  3. DIM AS FLOAT ff, fff, ffff
  4. s! = s!
  5. DIM AS SINGLE s000, s001, s010, s011, s100
  6. d# = d#
  7. DIM AS DOUBLE d000, d001, d010, d011, d100, d101
  8. f## = f##
  9. DIM AS FLOAT f000, f001, f010, f011, f100, f101, f110, f111
  10. a$ = "": darta$ = ""
  11. DIM llllllllll
  12.  
  13. ff = 1.0E30::: COLOR 12: PRINT "ff    ";: COLOR 15: PRINT ff##;::: PRINT USING "###,###,###,###,###,###,###,###,###,###,###"; ff##;::: COLOR 28: PRINT " precision  ";: COLOR 30: PRINT "$DEBUG 1D+30"
  14. fff = 1.0D30:: COLOR 12: PRINT "fff   ";: COLOR 15: PRINT fff##;:: PRINT USING "###,###,###,###,###,###,###,###,###,###,###"; fff##;:: COLOR 28: PRINT " precision  ";: COLOR 30: PRINT "$DEBUG 1D+30"
  15. ffff = 1.0F30: COLOR 10: PRINT "ffff  ";: COLOR 15: PRINT ffff##;: PRINT USING "###,###,###,###,###,###,###,###,###,###,###"; ffff##;: COLOR 26: PRINT " OK  $DEBUG = OK"
  16. s! = s!: COLOR 11: PRINT "_SINGLE    ";: PRINT "wiki !   -2.802597e-45   to   +3.402823e+38 ":
  17. s000 = 1E7:::::::::: COLOR 10: PRINT "s000  ";: COLOR 15: PRINT s000;: PRINT USING "###,###,###"; s000;: COLOR 26: PRINT " OK  $DEBUG = OK":
  18. s001 = 10E6::::::::: COLOR 10: PRINT "s001  ";: COLOR 15: PRINT s001;: PRINT USING "###,###,###"; s001;: COLOR 26: PRINT " OK  $DEBUG = OK":
  19. s010 = 3.402823E+38: COLOR 10: PRINT "s010  ";: COLOR 15: PRINT s010;: COLOR 26: PRINT " OK  $DEBUG = OK":
  20. s011 = 3.402824E+38: COLOR 12: PRINT "s011  ";: COLOR 15: PRINT s011;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage  ";: COLOR 30: PRINT "$DEBUG = INF + garbage"
  21. s100 = 1000000E1000: COLOR 12: PRINT "s100  ";: COLOR 15: PRINT s100;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage  ";: COLOR 30: PRINT "$DEBUG = INF + garbage"
  22. d# = d#: COLOR 11: PRINT "_DOUBLE    ";: PRINT "wiki # -4.490656458412465e-324   to   +1.797693134862310e+308": COLOR 15
  23. d000 = 1.797693134862310E+308: COLOR 10: PRINT "d000  ";: COLOR 15: PRINT d000;: COLOR 26: PRINT "  OK  $DEBUG = OK":
  24. d001 = 1.797693134862311E+308: COLOR 12: PRINT "d001  ";: COLOR 15: PRINT d001;: COLOR 30: PRINT " The value > than wiki limit - so INFINITE"
  25. d010 = 1.7976931348624E+308::: COLOR 12: PRINT "d010  ";: COLOR 15: PRINT d010;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage";: COLOR 30: PRINT "  $DEBUG = INF + garbage":
  26. d011 = 1.797693134862310D+308: COLOR 10: PRINT "d011  ";: COLOR 15: PRINT d011;: COLOR 26: PRINT "  OK  $DEBUG = OK":
  27. d100 = 1.797693134862311D+308: COLOR 12: PRINT "d100  ";: COLOR 15: PRINT d100;: COLOR 30: PRINT " The value > than wiki limit - so INFINITE"
  28. d101 = 1.7976931348624D+308::: COLOR 12: PRINT "d101  ";: COLOR 15: PRINT d101;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage";: COLOR 30: PRINT "  $DEBUG = INF + garbage":
  29. f## = f##: COLOR 11: PRINT "_FLOAT    ";: PRINT "wiki ##  -1.18e-4932   to   +1.18e+4932"::
  30. f000 = 1.18E+4932: COLOR 12: PRINT "f000  ";: COLOR 15: PRINT f000;: COLOR 30: PRINT " The value = wiki limit - so NOT infinite"
  31. f001 = 1.18E+4933: COLOR 12: PRINT "f001  ";: COLOR 15: PRINT f001;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage";: COLOR 26: PRINT "  $DEBUG = OK ":
  32. f010 = 1.18E+4930: COLOR 12: PRINT "f010  ";: COLOR 15: PRINT f010;: COLOR 30: PRINT " The value < wiki limit - so NOT infinite ":
  33. f011 = 1.18D+4932: COLOR 12: PRINT "f011  ";: COLOR 15: PRINT f011;: COLOR 30: PRINT " The value = wiki limit - so NOT infinite"
  34. f100 = 1.18D+4933: COLOR 12: PRINT "f100  ";: COLOR 15: PRINT f100;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage";: COLOR 26: PRINT "  $DEBUG = OK ":
  35. f101 = 1.18D+4930: COLOR 12: PRINT "f101  ";: COLOR 15: PRINT f101;: COLOR 30: PRINT " The value < wiki limit - so NOT infinite ";: LOCATE 24, 1
  36. f110 = 1.18F+4932: COLOR 12: PRINT "f110  ";: COLOR 15: PRINT f110;: COLOR 30: PRINT " The value = wiki limit - so NOT infinite";: LOCATE 25, 1
  37. f111 = 1.18F+4933: COLOR 12: PRINT "f111  ";: COLOR 15: PRINT f111;: COLOR 26: PRINT " INF = OK   ";: COLOR 28: PRINT "+ garbage";: COLOR 26: PRINT "  $DEBUG = OK ";:
  38. a$ = " ": darta$ = "DATA"
  39. DATA 123,e7,0e7,1e7,10e6,10e39,100000e1000,+3.402823e+38,+3.402824e+4932,+3.402823e+100000
  40. DATA 456,1d7,10d7,+1.797693134862310e+308,+1.797693134862310e+309
  41. DATA 789,1f7,10f7,100f7,1234f77,0,+1.18e+4932,+1.18d+4932,+1.18f+4932,+1.18f+100000
  42. DATA NotScientific,10000ee12345,12345e6789e123,123e45f00
  43. llllllllll = llllllllll: SYSTEM
  44.  
  45.  
  46.  






 [ You are not allowed to view this attachment ]
 [ You are not allowed to view this attachment ]  
 [ You are not allowed to view this attachment ]  
 [ You are not allowed to view this attachment ]  
 [ You are not allowed to view this attachment ]  
« Last Edit: September 30, 2021, 01:00:04 pm by odin »

FellippeHeitor

  • Guest
Re: [dev build] $DEBUG Scientific notation *** ultra low priority ***
« Reply #1 on: September 29, 2021, 06:51:56 am »
What you see in the watch panel is the result of STR$() converting numbers to a string for printing, so the same behavior applies

Watchpoints and scientific notation won’t be compatible either, at least not for now.