Feature #4612
closedEncode/decode floating-point number in TLV-VALUE
100%
Description
Define a convention of serializing floating-point number in TLV-VALUE.
Implement encoding and decoding functions in encoding/block-helpers.hpp
.
One use case is serializing a set of hyperbolic coordinates that contains floating-point numbers.
Updated by Junxiao Shi over 6 years ago
- Related to Bug #4609: NLSR unit test failing on ARM added
Updated by Ashlesh Gawande over 6 years ago
- Blocks Task #4615: Use the double encoding/decoding functions for hyperbolic coordinates added
Updated by Ashlesh Gawande about 6 years ago
Please assign to Tianxing Ma (https://redmine.named-data.net/users/796)
Updated by Davide Pesavento about 6 years ago
- Status changed from New to Code review
- Target version set to v0.7
Updated by Davide Pesavento about 6 years ago
What do we do with NaN and infinite values?
Also, why are the new helpers named readFloat
/makeFloatBlock
/etc..? They deal with doubles so using "Double" in the name instead of "Float" sounds more intuitive to me.
Updated by Junxiao Shi about 6 years ago
They deal with doubles so using "Double" in the name instead of "Float" sounds more intuitive to me.
"Float" is not wrong. double
is one of the C types for floating point numbers.
Updated by Davide Pesavento about 6 years ago
You're missing my point. I didn't say it's wrong, I said it's not intuitive because "float" is also a floating-point type in C/C++, and the fact that e.g. readFloat
returns a double
instead of a float
is probably surprising/confusing to most readers.
Updated by Ashlesh Gawande about 6 years ago
Davide Pesavento wrote:
You're missing my point. I didn't say it's wrong, I said it's not intuitive because "float" is also a floating-point type in C/C++, and the fact that e.g.
readFloat
returns adouble
instead of afloat
is probably surprising/confusing to most readers.
Yes, I think readDouble is more accurate here.
Updated by Ashlesh Gawande about 6 years ago
@Tianxing, could you please check whether we need representation of zero, NAN, infinite in NLSR hyperbolic coordinates encoding/decoding?
Updated by Davide Pesavento about 6 years ago
- Subject changed from Represent floating-point number as TLV-VALUE to Encode/decode floating-point number in TLV-VALUE
- Status changed from Code review to Feedback
- % Done changed from 0 to 100
Code has been merged. Do we need to document the encoding format somewhere?
Updated by Davide Pesavento almost 6 years ago
- Status changed from Feedback to Closed