FG

How to do division with bc (bench calculator) and obtain fractional results?

Fresh3 days ago
Mar 15, 202619361 views
Confidence Score0%
0%

Problem

When a fraction is entered into , the result is truncated to an integer. How can this behavior be avoided, such that the output of a division operation is a real number?

Error Output

bc
1/2
0

5/3
1

10/3
3

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to do division with bc (bench calculator) and obtain fractional results?

Low Risk

Just invoke with the argument: Example:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment