cbrtf - Linux


The cbrtf command calculates the cube root of a given number. It is primarily used for mathematical operations involving cubic equations, roots, and approximations.



Required arguments:

  • NUMBER: The number from which to extract the cube root.


  • –digits: Specify the number of digits to display in the output. Default: 6.
  • –help: Display usage information.
  • –version: Display version information.


  • –digits: This option allows users to control the precision of the output by specifying the number of digits to display after the decimal point.
  • –help: The --help option prints a short usage message to the standard output.
  • –version: The --version option prints the version of the cbrtf command to the standard output.


  • To calculate the cube root of 27:
$ cbrtf 27
  • To display the cube root with 10 digits of precision:
$ cbrtf --digits 10 27
  • To use cbrtf in a script:

root=$(cbrtf $num)

echo "The cube root of $num is $root"

Common Issues

  • Incorrect input: Ensure that the input number is a valid numeric value. Invalid inputs will result in an error message or incorrect output.
  • Precision limitations: The --digits option has a maximum limit. If the requested precision exceeds this limit, the output may be rounded or truncated.


cbrtf can be integrated with other commands and tools for complex calculations. For example, it can be used with the bc calculator to perform high-precision calculations:

$ echo "scale=20; cbrt(27)" | bc

Related Commands

  • sqrt: Calculates the square root of a number.
  • log10: Calculates the base-10 logarithm of a number.
  • pow: Calculates the result of raising a number to a specified power.