2

How to install dc (desktop calculator) in Cygwin?

dc is not found among Cygwin packages. Should it be compiled from the sources? What is the proper way?

ruvim
  • 7,151
  • 2
  • 27
  • 36
  • Perhaps this question better fits [Superuser](https://superuser.com/), but superuser doesn't even have the `[dc]` tag. Actually, `dc` is a toy for the programmers only ;) – ruvim Apr 26 '18 at 20:34

2 Answers2

3

dc is included into the package of bc (basic calculator). See the list of installed binaries at Cygwin Package Search website.

So, the command to install dc is:

apt-cyg install bc
ruvim
  • 7,151
  • 2
  • 27
  • 36
0

dc is wrong in cygwin. The command dc -e "2i B.Cp" does a number clamping to 1.5, which is default in bc but not in dc. The correct value would be 17.

Do not install it.

  • It seems, you rely on an undefined behavior when you uses B and C digits in the binary input radix. Try `16i B.Cp`, it prints 11.7 – ruvim Nov 16 '20 at 04:37