float.sizeof should be 4

Dom DiSc dominikus at scherkl.de
Mon Sep 23 23:08:37 UTC 2024


On Monday, 23 September 2024 at 05:34:51 UTC, Walter Bright wrote:
> I agree that it seems to make sense making 4 an `int`.

A number literal should always be of the smallest type that can 
represent it - it will be implicitly converted to larger types 
anyway.
So, 4 should be ubyte (as only negative literals should be of 
signed type and there is no smaller type in D than ubyte - else 
it should be of type "nibble" (4bit)).


More information about the Digitalmars-d mailing list