[Issue 16261] dmd -profile & nativeToLittleEndian() --> wrong result

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 8 22:07:24 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16261

dushibaiyu <dushibaiyu at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dushibaiyu at yahoo.com

--- Comment #1 from dushibaiyu <dushibaiyu at yahoo.com> ---
nativeToBigEndian aslo erro!

 import std.stdio;
 import std.bitmanip;


 enum ushort type = 100;

 void main()
 {
    ubyte[2] udt = nativeToBigEndian(type);
    writeln("100 as nativeToBigEndian : ", udt);
    ushort uy  = bigEndianToNative!(ushort)(udt);
    writeln("uy = : ", uy);
 }

the rulst:
100 as nativeToBigEndian : [13, 21]
uy = : 3349

--


More information about the Digitalmars-d-bugs mailing list