Q:

# What is pi in MATLAB?

A:

The expression pi in MATLAB returns the floating point number closest in value to the fundamental constant pi, which is defined as the ratio of the circumference of the circle to its diameter. Note that the MATLAB constant pi is not exactly equal to the fundamental constant pi.

## Keep Learning

MATLAB users should be aware that the tiny difference between pi as defined in MATLAB and the fundamental constant pi can lead to unexpected results in calculations. For example, the expression sin(pi), which one would expect to return 0, actually returns 1.2246e-16 in MATLAB. Users can correct this error by rounding the result of sin(pi) to 0.

Sources:

## Related Questions

• A: To convert a percentage to a ratio, write out the percentage number as a fraction, reduce the fraction to its simplest form and convert the new fraction to... Full Answer >
Filed Under:
• A: To divide a whole number by a decimal number, move the decimal point to the right in both numbers until the decimal is a whole number. Then, divide the num... Full Answer >
Filed Under:
• A: Long division with decimals is functionally the same as long division without decimals, but you have to move the decimal point of the divisor and dividend ... Full Answer >
Filed Under:
• A: To subtract decimals, stack both numbers so the decimal point is in the same position, and add zeros to the right of the number with fewer digits. Subtract... Full Answer >
Filed Under:
PEOPLE SEARCH FOR