Variable size/Set: Difference between revisions
m
→{{header|Julia}}
Line 297:
for t in types
println("For type ", lpad(t,6), " size is $(sizeof(t)) 8-bit
lpad(string(8*sizeof(t)), 2), " bits.")
end
Line 305:
println("\nFor the 24-bit user defined type MyInt24, size is ", sizeof(MyInt24), " bytes.")
</lang> {{output}} <pre>
For type Bool size is 1 8-bit
For type Char size is 4 8-bit
For type Int8 size is 1 8-bit
For type UInt8 size is 1 8-bit
For type Int16 size is 2 8-bit
For type UInt16 size is 2 8-bit
For type Int32 size is 4 8-bit
For type UInt32 size is 4 8-bit
For type Int64 size is 8 8-bit
For type UInt64 size is 8 8-bit
For the 24-bit user defined type MyInt24, size is 3 bytes.
|