Project

General

Profile

Actions

Feature #4612

closed

Encode/decode floating-point number in TLV-VALUE

Added by Junxiao Shi over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

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.


Related issues 2 (0 open2 closed)

Related to NLSR - Bug #4609: NLSR unit test failing on ARMClosed05/09/2018

Actions
Blocks NLSR - Task #4615: Use the double encoding/decoding functions for hyperbolic coordinatesClosedSaurab Dulal05/20/2018

Actions
Actions #1

Updated by Junxiao Shi over 6 years ago

  • Related to Bug #4609: NLSR unit test failing on ARM added
Actions #2

Updated by Ashlesh Gawande over 6 years ago

  • Blocks Task #4615: Use the double encoding/decoding functions for hyperbolic coordinates added
Actions #3

Updated by Ashlesh Gawande about 6 years ago

Please assign to Tianxing Ma (https://redmine.named-data.net/users/796)

Actions #4

Updated by Junxiao Shi about 6 years ago

  • Assignee set to Tianxing Ma
Actions #5

Updated by Davide Pesavento about 6 years ago

  • Status changed from New to Code review
  • Target version set to v0.7
Actions #6

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.

Actions #7

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.

Actions #8

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.

Actions #9

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 a double instead of a float is probably surprising/confusing to most readers.

Yes, I think readDouble is more accurate here.

Actions #10

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?

Actions #11

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?

Actions #12

Updated by Davide Pesavento over 5 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF