{"id":210530,"date":"2021-06-07T10:32:18","date_gmt":"2021-06-07T05:02:18","guid":{"rendered":"https:\/\/fossbytes.com\/?p=210530"},"modified":"2021-06-07T10:38:24","modified_gmt":"2021-06-07T05:08:24","slug":"how-to-use-gnu-basic-calculator","status":"publish","type":"post","link":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/","title":{"rendered":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?"},"content":{"rendered":"\n<p class=\"has-drop-cap\">Almost all POSIX-compliant operating system comes with decades-old GNU bc utility by default. GNU bc (Basic Calculator) is an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Arbitrary-precision_arithmetic\" class=\"ek-link\">arbitrary precision<\/a> mathematical scripting language. <\/p>\n\n\n\n<p>Bc has syntax similar to the <a href=\"https:\/\/fossbytes.com\/c-programming-language-highest-vulnerabilities-2019\/\" target=\"_blank\" aria-label=\"C programming language (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">C programming language<\/a>. Not just syntax, Bc also provides features that you find in every other programming language.<\/p>\n\n\n\n<p>For instance, control statements using if\/else, iterative statements using for or while loop, math functions, conditional statements, and different types of operators like arithmetic, logical, and assignment.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"733\" height=\"388\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Basic-Calculator-bc.png\" alt=\"Basic Calculator (bc)\" class=\"wp-image-212614\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Basic-Calculator-bc.png 733w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Basic-Calculator-bc-300x159.png 300w\" sizes=\"(max-width: 733px) 100vw, 733px\" \/><figcaption>Basic Calculator (bc)<\/figcaption><\/figure><\/div>\n\n\n\n<p>You can use the bc utility to perform basic and advanced mathematical calculations in your shell scripts using the echo command.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"156\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Use-bc-in-shell-script.png\" alt=\"Use bc in shell script\" class=\"wp-image-212645\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Use-bc-in-shell-script.png 741w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Use-bc-in-shell-script-300x63.png 300w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><figcaption>Use bc in shell script<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-interactive-mode-in-bc\">Interactive Mode In Bc<\/h2>\n\n\n\n<p>Interestingly, basic calculator also provides an interactive mathematical shell to execute operations. By just typing &#8216;bc&#8217; in your terminal, you can get into an interactive mode and test all available functions and expressions.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"260\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Bc-interactive-mode.png\" alt=\"Bc interactive mode\" class=\"wp-image-212647\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Bc-interactive-mode.png 736w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Bc-interactive-mode-300x106.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><figcaption>Basic calculator interactive mode<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-advanced-bc-functions-using-mathlib\">Advanced Bc Functions Using mathlib<\/h2>\n\n\n\n<p>For doing advanced math calculation using sine, cosine, and logarithm functions, bc provides a standard math library. It can be used by loading it using a command-line option <code>--mathlib<\/code> or <code>-l<\/code> with bc.<\/p>\n\n\n\n<p>Currently, the mathlib supports the following functions :<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>s (x) for sine<\/li><li>c (x) for cosine<\/li><li>a (x) for arctangent<\/li><li>l (x) for natural logarithm<\/li><li>e (x) for the exponential function of raising e to the value x<\/li><li>j (n,x) for the bessel function of integer order n of x<\/li><li>sqrt(x) for square root<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"206\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/bc-built-in-functions.png\" alt=\"bc built-in functions\" class=\"wp-image-212669\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/bc-built-in-functions.png 899w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/bc-built-in-functions-300x69.png 300w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/bc-built-in-functions-768x176.png 768w\" sizes=\"(max-width: 899px) 100vw, 899px\" \/><figcaption>basic calculator built-in functions<\/figcaption><\/figure><\/div>\n\n\n\n<p>Additionally, mathlib also supports the following special functions:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>length(x) for the number of digits in x<\/li><li>read() to read the number from the standard input<\/li><li>scale(expression) for the number of digits after the decimal point in the expression<\/li><li>ibase and obase for the conversion base for input and output numbers<\/li><li>last (an extension) that holds the value of the last printed number<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-make-custom-bc-functions\">Make Custom Bc Functions<\/h2>\n\n\n\n<p>Along with built-in functions, basic calculator also lets you create your own functions as per your need. To make a custom function, you need to start it with <code>define<\/code> keyword using the following syntax:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define function_name ( parameters ) {\n    statement...\n    return statement;\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"895\" height=\"223\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Define-own-bc-function-1.png\" alt=\"\" class=\"wp-image-212674\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Define-own-bc-function-1.png 895w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Define-own-bc-function-1-300x75.png 300w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Define-own-bc-function-1-768x191.png 768w\" sizes=\"(max-width: 895px) 100vw, 895px\" \/><figcaption>Define own bc function<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-convert-binary-to-decimal-and-decimal-to-binary-using-bc\">Convert Binary To Decimal And Decimal To Binary Using Bc<\/h2>\n\n\n\n<p>Using the ibase and obase variable, you can also convert binary to decimal and vice-versa.<\/p>\n\n\n\n<p>To convert binary to decimal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo 'ibase=2;obase=A;11' | bc -l<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"135\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/binary-to-decimal-using-bc.png\" alt=\"binary to decimal using bc\" class=\"wp-image-212671\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/binary-to-decimal-using-bc.png 894w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/binary-to-decimal-using-bc-300x45.png 300w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/binary-to-decimal-using-bc-768x116.png 768w\" sizes=\"(max-width: 894px) 100vw, 894px\" \/><figcaption>binary to decimal using basic calculator<\/figcaption><\/figure><\/div>\n\n\n\n<p>To convert decimal to binary:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo 'ibase=10;obase=2;3' | bc<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"98\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/decimal-to-binary-using-bc.png\" alt=\"decimal to binary using bc\" class=\"wp-image-212672\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/decimal-to-binary-using-bc.png 897w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/decimal-to-binary-using-bc-300x33.png 300w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/decimal-to-binary-using-bc-768x84.png 768w\" sizes=\"(max-width: 897px) 100vw, 897px\" \/><figcaption>decimal to binary using basic calculator<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-take-input-from-a-file\">Take Input From A File<\/h2>\n\n\n\n<p>Instead of typing expressions each time, you can also put your all math expression in a file and execute it using the bc command.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"240\" src=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Take-input-from-file-1.png\" alt=\"\" class=\"wp-image-212673\" srcset=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Take-input-from-file-1.png 898w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Take-input-from-file-1-300x80.png 300w, https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/Take-input-from-file-1-768x205.png 768w\" sizes=\"(max-width: 898px) 100vw, 898px\" \/><figcaption>Take input from file<\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It has syntax similar to the C programming language.<\/p>\n","protected":false},"author":183,"featured_media":212611,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[1828,410],"tags":[11780,10632,287],"class_list":["post-210530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geek","category-how-to","tag-a-z-linux-commands","tag-gnu-bc","tag-linux"],"featured_image_src":"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/How-To-Use-GNU-Basic-Calculator-Bc-In-Linux-For-Math-Calculation.jpg","author_info":{"display_name":"Sarvottam Kumar","author_link":"https:\/\/fossbytes.com\/author\/sarvottam\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v21.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?<\/title>\n<meta name=\"description\" content=\"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?\" \/>\n<meta property=\"og:description\" content=\"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\" \/>\n<meta property=\"og:site_name\" content=\"Fossbytes\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fossbytes\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-07T05:02:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-07T05:08:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/How-To-Use-GNU-Basic-Calculator-Bc-In-Linux-For-Math-Calculation.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sarvottam Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/sarru1291\" \/>\n<meta name=\"twitter:site\" content=\"@fossbytes14\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sarvottam Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\"},\"author\":{\"name\":\"Sarvottam Kumar\",\"@id\":\"https:\/\/fossbytes.com\/#\/schema\/person\/15a8bd6e8f6f2035bf8a0869693ee071\"},\"headline\":\"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?\",\"datePublished\":\"2021-06-07T05:02:18+00:00\",\"dateModified\":\"2021-06-07T05:08:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\"},\"wordCount\":438,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fossbytes.com\/#organization\"},\"keywords\":[\"A-Z Linux Commands\",\"GNU bc\",\"linux\"],\"articleSection\":[\"Geek\",\"How To\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\",\"url\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\",\"name\":\"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?\",\"isPartOf\":{\"@id\":\"https:\/\/fossbytes.com\/#website\"},\"datePublished\":\"2021-06-07T05:02:18+00:00\",\"dateModified\":\"2021-06-07T05:08:24+00:00\",\"description\":\"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.\",\"breadcrumb\":{\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fossbytes.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Geek\",\"item\":\"https:\/\/fossbytes.com\/category\/geek\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fossbytes.com\/#website\",\"url\":\"https:\/\/fossbytes.com\/\",\"name\":\"Fossbytes\",\"description\":\"Technology Simplified\",\"publisher\":{\"@id\":\"https:\/\/fossbytes.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fossbytes.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fossbytes.com\/#organization\",\"name\":\"Fossbytes Media Pvt Ltd\",\"url\":\"https:\/\/fossbytes.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fossbytes.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/01\/FOSSBYTES-LOGO-NEW-1-1.png\",\"contentUrl\":\"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/01\/FOSSBYTES-LOGO-NEW-1-1.png\",\"width\":1126,\"height\":281,\"caption\":\"Fossbytes Media Pvt Ltd\"},\"image\":{\"@id\":\"https:\/\/fossbytes.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/fossbytes\",\"https:\/\/twitter.com\/fossbytes14\",\"https:\/\/instagram.com\/fossbytes\/\",\"https:\/\/www.linkedin.com\/company\/9360813\",\"https:\/\/www.pinterest.com\/source\/fossbytes.com\/\",\"https:\/\/www.youtube.com\/@FossbytesOfficial\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/fossbytes.com\/#\/schema\/person\/15a8bd6e8f6f2035bf8a0869693ee071\",\"name\":\"Sarvottam Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fossbytes.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/489b9ec01b11e8a031609a9ff076336b?s=96&d=mm\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/489b9ec01b11e8a031609a9ff076336b?s=96&d=mm\",\"caption\":\"Sarvottam Kumar\"},\"description\":\"Sarvottam Kumar is a software engineer by profession with interest and experience in Blockchain, Angular, React and Flutter. He loves to explore the nuts and bolts of Linux and share his experience and insights of Linux and open source on the web\/various prestigious portals.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sarru1291\/\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/sarru1291\"],\"url\":\"https:\/\/fossbytes.com\/author\/sarvottam\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?","description":"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/","og_locale":"en_US","og_type":"article","og_title":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?","og_description":"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.","og_url":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/","og_site_name":"Fossbytes","article_publisher":"https:\/\/www.facebook.com\/fossbytes","article_published_time":"2021-06-07T05:02:18+00:00","article_modified_time":"2021-06-07T05:08:24+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/How-To-Use-GNU-Basic-Calculator-Bc-In-Linux-For-Math-Calculation.jpg","type":"image\/jpeg"}],"author":"Sarvottam Kumar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/sarru1291","twitter_site":"@fossbytes14","twitter_misc":{"Written by":"Sarvottam Kumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#article","isPartOf":{"@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/"},"author":{"name":"Sarvottam Kumar","@id":"https:\/\/fossbytes.com\/#\/schema\/person\/15a8bd6e8f6f2035bf8a0869693ee071"},"headline":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?","datePublished":"2021-06-07T05:02:18+00:00","dateModified":"2021-06-07T05:08:24+00:00","mainEntityOfPage":{"@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/"},"wordCount":438,"commentCount":0,"publisher":{"@id":"https:\/\/fossbytes.com\/#organization"},"keywords":["A-Z Linux Commands","GNU bc","linux"],"articleSection":["Geek","How To"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/","url":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/","name":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?","isPartOf":{"@id":"https:\/\/fossbytes.com\/#website"},"datePublished":"2021-06-07T05:02:18+00:00","dateModified":"2021-06-07T05:08:24+00:00","description":"GNU bc (Basic Calculator) is an arbitrary precision mathematical scripting language with decades-old GNU bc utility by default.","breadcrumb":{"@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fossbytes.com\/how-to-use-gnu-basic-calculator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fossbytes.com\/"},{"@type":"ListItem","position":2,"name":"Geek","item":"https:\/\/fossbytes.com\/category\/geek\/"},{"@type":"ListItem","position":3,"name":"How To Use GNU Basic Calculator (Bc) In Linux For Math Calculation?"}]},{"@type":"WebSite","@id":"https:\/\/fossbytes.com\/#website","url":"https:\/\/fossbytes.com\/","name":"Fossbytes","description":"Technology Simplified","publisher":{"@id":"https:\/\/fossbytes.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fossbytes.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fossbytes.com\/#organization","name":"Fossbytes Media Pvt Ltd","url":"https:\/\/fossbytes.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fossbytes.com\/#\/schema\/logo\/image\/","url":"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/01\/FOSSBYTES-LOGO-NEW-1-1.png","contentUrl":"https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/01\/FOSSBYTES-LOGO-NEW-1-1.png","width":1126,"height":281,"caption":"Fossbytes Media Pvt Ltd"},"image":{"@id":"https:\/\/fossbytes.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fossbytes","https:\/\/twitter.com\/fossbytes14","https:\/\/instagram.com\/fossbytes\/","https:\/\/www.linkedin.com\/company\/9360813","https:\/\/www.pinterest.com\/source\/fossbytes.com\/","https:\/\/www.youtube.com\/@FossbytesOfficial\/"]},{"@type":"Person","@id":"https:\/\/fossbytes.com\/#\/schema\/person\/15a8bd6e8f6f2035bf8a0869693ee071","name":"Sarvottam Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fossbytes.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/489b9ec01b11e8a031609a9ff076336b?s=96&d=mm","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/489b9ec01b11e8a031609a9ff076336b?s=96&d=mm","caption":"Sarvottam Kumar"},"description":"Sarvottam Kumar is a software engineer by profession with interest and experience in Blockchain, Angular, React and Flutter. He loves to explore the nuts and bolts of Linux and share his experience and insights of Linux and open source on the web\/various prestigious portals.","sameAs":["https:\/\/www.linkedin.com\/in\/sarru1291\/","https:\/\/twitter.com\/https:\/\/twitter.com\/sarru1291"],"url":"https:\/\/fossbytes.com\/author\/sarvottam\/"}]}},"taxonomy_info":{"category":[{"value":1828,"label":"Geek"},{"value":410,"label":"How To"}],"post_tag":[{"value":11780,"label":"A-Z Linux Commands"},{"value":10632,"label":"GNU bc"},{"value":287,"label":"linux"}]},"featured_image_src_large":["https:\/\/fossbytes.com\/wp-content\/uploads\/2021\/06\/How-To-Use-GNU-Basic-Calculator-Bc-In-Linux-For-Math-Calculation-1024x576.jpg",1024,576,true],"comment_info":0,"category_info":[{"term_id":1828,"name":"Geek","slug":"geek","term_group":0,"term_taxonomy_id":1830,"taxonomy":"category","description":"The Geek section of Fossbytes features trending developments, features, and useful guides on Linux distros, programming, single board computers, and DIY projects. Here you can also browse new stories on various open source technologies and budding projects.","parent":0,"count":824,"filter":"raw","cat_ID":1828,"category_count":824,"category_description":"The Geek section of Fossbytes features trending developments, features, and useful guides on Linux distros, programming, single board computers, and DIY projects. Here you can also browse new stories on various open source technologies and budding projects.","cat_name":"Geek","category_nicename":"geek","category_parent":0},{"term_id":410,"name":"How To","slug":"how-to","term_group":0,"term_taxonomy_id":411,"taxonomy":"category","description":"Technology\u2019s ultimate purpose is to make things easier for us. In this section, we try to bolster that goal with our in-depth yet simple how-to articles. These guides are one of the top-visited pages of Fossbytes. These pieces revolve around simple and useful tips to improve the productivity of your computers, phones, and other devices. We also try to solve hot searched problems and queries requested by the users in this section.","parent":0,"count":1259,"filter":"raw","cat_ID":410,"category_count":1259,"category_description":"Technology\u2019s ultimate purpose is to make things easier for us. In this section, we try to bolster that goal with our in-depth yet simple how-to articles. These guides are one of the top-visited pages of Fossbytes. These pieces revolve around simple and useful tips to improve the productivity of your computers, phones, and other devices. We also try to solve hot searched problems and queries requested by the users in this section.","cat_name":"How To","category_nicename":"how-to","category_parent":0}],"tag_info":[{"term_id":11780,"name":"A-Z Linux Commands","slug":"a-z-linux-commands","term_group":0,"term_taxonomy_id":11781,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":10632,"name":"GNU bc","slug":"gnu-bc","term_group":0,"term_taxonomy_id":10633,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":287,"name":"linux","slug":"linux","term_group":0,"term_taxonomy_id":288,"taxonomy":"post_tag","description":"","parent":0,"count":511,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/posts\/210530"}],"collection":[{"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/users\/183"}],"replies":[{"embeddable":true,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/comments?post=210530"}],"version-history":[{"count":10,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/posts\/210530\/revisions"}],"predecessor-version":[{"id":212696,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/posts\/210530\/revisions\/212696"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/media\/212611"}],"wp:attachment":[{"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/media?parent=210530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/categories?post=210530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fossbytes.com\/wp-json\/wp\/v2\/tags?post=210530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}