Bug 4255 - dc: example fails
Summary: dc: example fails
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.19.x
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-23 15:45 UTC by Bee
Modified: 2013-01-18 12:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bee 2011-09-23 15:45:34 UTC
dc: example fails

'dc 8 8 * 2 2 + / p' -> 16

The '*' needs to be escaped on the commandline as:

'dc 8 8 \* 2 2 + / p' -> 16

or

'dc 8 8 mul 2 2 + / p' -> 16


BusyBox v1.19.2 (2011-09-22 22:34:25 PDT) multi-call binary.

Usage: dc EXPRESSION...

Tiny RPN calculator. Operations:
+, add, -, sub, *, mul, /, div, %, mod, **, exp, and, or, not, eor,
p - print top of the stack (without popping),
f - print entire stack,
o - pop the value and set output radix (must be 10, 16, 8 or 2).
Examples: 'dc 2 2 add p' -> 4, 'dc 8 8 * 2 2 + / p' -> 16
Comment 1 Denys Vlasenko 2013-01-18 12:31:14 UTC
Fixed in git.