{"id":65,"date":"2010-12-09T02:43:25","date_gmt":"2010-12-09T00:43:25","guid":{"rendered":"http:\/\/blog.philippgoecke.de\/?p=65"},"modified":"2010-12-09T02:44:51","modified_gmt":"2010-12-09T00:44:51","slug":"basic-calculator-bc","status":"publish","type":"post","link":"https:\/\/stls.eu\/blog\/2010\/12\/09\/basic-calculator-bc\/","title":{"rendered":"Basic Calculator bc"},"content":{"rendered":"<pre class=\"brush:shell\">user@linux(Ubuntu 10.10):~$ bc -l\r\nbc 1.06.95\r\nCopyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.\r\nThis is free software with ABSOLUTELY NO WARRANTY.\r\nFor details type `warranty'.\r\n1+1 # Eingabe\r\n2 # Ausgabe\r\n7+5^4 # Eingabe\r\n632 # Ausgabe\r\nsqrt(3) # Eingabe\r\n1.73205080756887729352 # Ausgabe\r\na=5 # Eingabe\r\na+2 # Eingabe\r\n7 # Ausgabe\r\ndefine f(x) { return x+3 } # Eingabe\r\nf(5) # Eingabe\r\n8 # Ausgabe\r\nscale=100 # Eingabe -> Ver\u00e4ndert die l\u00e4nge der Nachkommastellen\r\ndefine abs(x) { if ( x<0 ) return -x; return x } # Eingabe -> Betragsfunktion\r\ndefine sgn(x) { if ( x==0 ) return 0 else { if ( x<0 ) return -1; return 1 } } # Eingabe -> Signumfunktion\r\ndefine fact (x) { if(x < 1) return 1 ; return (x*fact(x-1)) } # Eingabe -> Produkt der ganzen Zahlen von 1 bis x\r\nfact(5) # Eingabe\r\n120 # Ausgabe\r\n#\r\nquit # Programm beenden :-D\r\n#\r\n#Diese Definitionen k\u00f6nnen auch in einer Datei einfach abgelegt werden und wie folgt wieder beim Programmstart eingelesen werden.\r\nuser@linux(Ubuntu 10.10):~$ bc -l mydefs.file # \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>user@linux(Ubuntu 10.10):~$ bc -l bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty&#8217;. 1+1 # Eingabe 2 # Ausgabe 7+5^4 # Eingabe 632 # &hellip; <a href=\"https:\/\/stls.eu\/blog\/2010\/12\/09\/basic-calculator-bc\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,18],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-linux","category-shell"],"_links":{"self":[{"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":3,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":69,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions\/69"}],"wp:attachment":[{"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stls.eu\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}