Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ConvertTo
#4
It's just a personal preference.  I'd personallu rather just have a single command than have to have a different one for each type out there.

bit, byte, integer, long,  integer64 -- all signed and unsigned
single, double, float
offset -- signed and unsigned

15 new commands just to convert a value to the proper type.  (If I'm counting right at 4AM in the morning.  Big Grin )

If one was to go that route, I think I'd personally prefer a very simple number type system:

Int1, Int8, Int16, Int32,Int64 -- all integers, with the number being the number of bits in them.
UInt1, UInt8, UInt16, UInt32, UInt64 -- all unsigned integers, with the numbers representing bits in them.
Float32, Float64, Float256 -- same here for floating point values.

Short names, with less typing involved, and which would all group closely together and be easily to see/highlight in the wiki for learning purposes.  (Personally, I think having to type _Unsigned_Integer64(-1 * UL) would end up breaking my fingers after pasting it into the machine 1000 times. )
Reply


Messages In This Thread
ConvertTo - by SMcNeill - 02-25-2024, 02:19 AM
RE: ConvertTo - by Pete - 02-25-2024, 07:39 AM
RE: ConvertTo - by Jack - 02-25-2024, 08:43 AM
RE: ConvertTo - by SMcNeill - 02-25-2024, 08:58 AM



Users browsing this thread: 1 Guest(s)