Bug #2361

Wrong sending of decimal numbers using RSB send

Added by D. Barbot over 8 years ago. Updated over 8 years ago.

Status:ResolvedStart date:08/17/2015
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Common Lisp Tools
Target version:rsb-0.13

Description

Using RSB send tool to send some decimal numbers seems to actually be sending them without the first zeros after the coma.
For instance:
rsb-toolscl0.13 send -l/vol/toolkit/nightly/trusty/x86_64/successful/share/rst0.13/proto/stable/rst/math/VectorDouble.proto 'pb:.rst.math.VectorDouble:{data: [0.0,0.0001]}' 'spread:/my/scope'
will result in [0.0, 0.1]

Associated revisions

Revision d87a70ba
Added by J. Moringen over 8 years ago

Fixed parsing decimals in float literals in common/protocol-buffer-payload.lisp

fixes #2361

The logic for parsing decimals in float literals was completely wrong.

  • common/protocol-buffer-payload.lisp (parse-integer-literal): renamed
    parse-{number -> integer}-literal
    (parse-hex-literal): adapted
    (parse-decimal-literal): likewise
    (parse-octal-literal): likewise
    (decimal-digit-char?): new function; predicate for decimal digit
    (defrule float-decimals): new rule; parse decimals in float literals
    (defrule float): use it
  • test/common/protocol-buffer-payload.lisp
    (test protocol-buffer-payload-root::grammar/smoke): added cases
    exercising decimals in float literals

History

#1 Updated by J. Moringen over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF