• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pi Command Examples in Linux

by Deepika

The pi command is a command-line tool that calculates the mathematical constant π (pi) to a specified number of decimal places. The calculation of π is based on Archimedes’ method, which involves inscribing and circumscribing polyggonal shapes around a circle and successively increasing the number of sides to estimate the value of π.

The pi command can be used in a variety of environments, including Unix-like systems and Windows command prompt, to quickly compute the value of π to the desired precision. For example, to calculate π to 20 decimal places, you would run the following command:

# pi 20

This would output the following result:

3.1415926535897932384

The pi command is a useful tool for anyone who needs to perform calculations involving π, such as students, researchers, and engineers. Additionally, it is a fun way to explore the properties of the mathematical constant and learn more about the fascinating history of its discovery and computation.

pi Command Examples

1. Display 100 decimal digits of Archimedes’ constant Pi:

# pi

2. Display a specified number of decimal digits of Archimedes’ constant Pi:

# pi number

3. Display help:

# pi --help

4. Display version:

# pi --version

5. Display recommended readings:

# pi --bibliography

Filed Under: Linux

Some more articles you might also be interested in …

  1. Linux OS Service ‘microcode_ctl’
  2. How to Permanently set the ethtool settings in CentOS/RHEL 6
  3. How to Install Gnome Desktop Environment onto Oracle Linux 6.x
  4. unlink: command not found
  5. Understanding MySQL Pluggable Authentication
  6. ledctl: command not found
  7. links: command not found
  8. chcon command examples in Linux
  9. CentOS / RHEL : Move a Physical Volume from an existing Volume Group to another Volume Group
  10. How to Configure Remote Rsyslog To Accept TLS and Non-TLS in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright