FG
💻 Software

Why does the expression exp(i*pi) return the wrong result in GNU Octave?

Fresh7 days ago
Mar 15, 2026635 views
Confidence Score0%
0%

Problem

I started to learn GNU Octave today, and tried the first expression given in the manual The result is And it seems GNU Scientific Library gives similar results too. So is this a Octave bug, or general problems of numeric analysis software (symbolic evaluation software will definitely give an answer…

Error Output

exp(i*pi)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Why does the expression exp(i*pi) return the wrong result in GNU Octave?

Low Risk

This isn't a bug with either, but due to the way computers perform floating point operations. There is a limited amount of precision any computer can operate with, and so you will sometimes see anomalies like this. While it is possible to write soft…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment