Code to show things, rather than hundreds or thousands of words:
Code: Select all
' FB_num_data-types.bas -- (c) 2021-01-26, MrSwiss
' demo code start
Dim As String t = "Numeric data-types and their sizes, in Byte(s) & bits", _
cmsg(1) = { "FBC x64 used!", "FBC x32 used!" }
Print t : Print String(Len(t), "~") : Print ' title | underline | LF
Print "whole numbers (fixed size)"
Print SizeOf(UByte); " Byte", SizeOf(Byte) * 8; " bits (U/Byte)"
Print SizeOf(UShort); " Bytes", SizeOf(Short) * 8; " bits (U/Short)"
Print SizeOf(ULong); " Bytes", SizeOf(Long) * 8; " bits (U/Long)"
Print SizeOf(ULongInt); " Bytes", SizeOf(LongInt) * 8; " bits (U/LongInt)"
Print
Print "floating point numbers (fixed size)"
Print SizeOf(Single); " Bytes", SizeOf(Single) * 8; " bits (Single)"
Print SizeOf(Double); " Bytes", SizeOf(Double) * 8; " bits (Double)"
Print
Print "whole numbers (variable size / compiler bitness / pointer size)"
Print SizeOf(UInteger); " Bytes", SizeOf(Integer) * 8; " bits (U/Integer)"
Print
Print IIf(SizeOf(Any Ptr) = 8, cmsg(0), cmsg(1)) ' instant If instead of: _
Print ' If ... Then ,,, Else ...
Sleep
' ----- EOF -----
You'll see the difference yourself.
Comments in code may clarify issues ...