Project

General

Profile

Feature #4612

Encode/decode floating-point number in TLV-VALUE

Added by Junxiao Shi almost 3 years ago. Updated about 2 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

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
#1

Updated by Junxiao Shi almost 3 years ago

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

Updated by Ashlesh Gawande almost 3 years ago

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

Updated by Ashlesh Gawande over 2 years ago

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

#4

Updated by Junxiao Shi over 2 years ago

  • Assignee set to Tianxing Ma
#5

Updated by Davide Pesavento over 2 years ago

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

Updated by Davide Pesavento over 2 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.

#7

Updated by Junxiao Shi over 2 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.

#8

Updated by Davide Pesavento over 2 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.

#9

Updated by Ashlesh Gawande over 2 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.

#10

Updated by Ashlesh Gawande over 2 years ago

@Tianxing, could you please check whether we need representation of zero, NAN, infinite in NLSR hyperbolic coordinates encoding/decoding?

#11

Updated by Davide Pesavento over 2 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?

#12

Updated by Davide Pesavento about 2 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF