Skip to content

C++ big endian encoding of floating point fields doesn't seem to be working correctly #530

@arobenko

Description

@arobenko

When using byteOrder="bigEndian" in message schema definition (littleEndian works fine) with simple
field definition of

<field name="field1" id="11" type="float"/>

The attempt to encode floating point value seems to drop the part after decimal point:

msg.field1(5.4f);
std::cout << "value=" << msg.field1() << std::endl; 

prints "value=5" (without .4)

The dump of the buffer shows: { 0, 0, 160, 76 }

When the same piece of code executed with "littleEndian" byte order it prints "value=5.4" and dump of the buffer shows: { 205, 204, 172, 64 }

Reproduced with v1.7.4 on Ubuntu 16.04 64bit with gcc v5.4.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions