Description of problem: dc accepts the inputn of numbers outside the "input base". This rather confusing. That makes it hard to see this as a feature and not as a bug. Version-Release number of selected component (if applicable): bc-1.06-17.1 How reproducible: always Steps to Reproduce: 1. echo "10 i ABCDEF p"|dc 2. 3. Actual results: 1123455 Expected results: dc should ignore numbers ouside the input base and print some sort of error message instead. Additional info: dc mixes 10 base and 16 base in the above example, as the next command (with identical result as the above command) shows: echo "10 i 10 100000 * 11 10000 * + 12 1000 * + 13 100 * + 14 10 * + 15 + p"|dc 1123455 Other - even more confusing - examples can be added easily but I hope the above is clear enough. I'll try to attach a patch for a quick solution. (I do realize dc seems to be basically umaintained as there hasn't been any change to the code in years. Still, I guess fixing this confusing behaviour could be useful ...)
Created attachment 112229 [details] patch to let dc handle numbers outside the input base sanely
Comment on attachment 112229 [details] patch to let dc handle numbers outside the input base sanely Please disregard the patch. It only (sort of) works if a number starts with a digit outside of the input base. I'll have to try again ...
Fedora Core 3 is now maintained by the Fedora Legacy project for security updates only. If this problem is a security issue, please reopen and reassign to the Fedora Legacy product. If it is not a security issue and hasn't been resolved in the current FC5 updates or in the FC6 test release, reopen and change the version to match. Thank you!
Now dc accepts the input which contains wrong symbols of radix in same way like bc.