precision for floating number fails after 15th decimal

Bug #1805003 reported by kenn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gawk (Ubuntu)
New
Undecided
Unassigned

Bug Description

I noticed that gawk floating number calculator function (mpfr_atan2) prints wrong numbers after 15th decimal.

The following gawk command prints pi:

`awk 'BEGIN { x = 1; y = 1; result = 4*atan2 (y,x); printf " %.20f degrees\n", result}'`

`3.14159265358979311600 degrees`

But it must be `3.14159265358979323846`

Revision history for this message
kenn (whatnext) wrote :

It's not a bug, precision value must be set in the follwing way:
awk -M -v PREC=10000 'BEGIN { x = 1; y = 1; result = 4*atan2 (y,x); printf " %.50f\n", result}'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.