
{"id":16258,"date":"2015-01-12T13:21:49","date_gmt":"2015-01-12T13:21:49","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16258"},"modified":"2015-01-12T13:21:49","modified_gmt":"2015-01-12T13:21:49","slug":"an-arbitrary-precision-calculator","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2015\/01\/12\/an-arbitrary-precision-calculator\/","title":{"rendered":"Hacking with an arbitrary precision calculator"},"content":{"rendered":"<pre>\ndc  is a reverse-polish desk calculator which supports unlimited preci\u2010\nsion arithmetic.  It also allows you to define and call  macros.   Nor\u2010\nmally  dc  reads  from the standard input; if any command arguments are\ngiven to it, they are filenames, and dc reads and executes the contents\nof  the files before reading from standard input.  All normal output is\nto standard output; all error output is to standard error.\n\nA reverse-polish calculator stores numbers on a stack.  Entering a num\u2010\nber  pushes  it  on the stack.  Arithmetic operations pop arguments off\nthe stack and push the results.\n\nTo enter a number in dc, type the digits (using upper  case  letters  A\nthrough  F as \"digits\" when working with input bases greater than ten),\nwith an optional decimal point.  Exponential notation is not supported.\nTo  enter a negative number, begin the number with ``_''.  ``-'' cannot\nbe used for this, as it is a binary operator for  subtraction  instead.\nTo  enter  two numbers in succession, separate them with spaces or new\u2010\nlines.  These have no meaning as commands.\n\n\n\n\n\n$dc\n1234\nf\n1234\n2322\nf\n2322\n1234\np * 2\n2322\nf\n2\n2865348\nf\n2\n2865348\n2 * p\n4\nf\n4\n2865348\np * 1\n4\np\n1\np\n1\nf\n1\n11461392\ndc:\ndc: stack empty\nf\n$\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>dc is a reverse-polish desk calculator which supports unlimited preci\u2010 sion arithmetic. It also allows you to define and call macros. Nor\u2010 mally dc reads from the standard input; if any command arguments are given to it, they are filenames, and dc reads and executes the contents of the files before reading from standard input. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2015\/01\/12\/an-arbitrary-precision-calculator\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Hacking with an arbitrary precision calculator&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[28],"tags":[629],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16258"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16258"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16258\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}