[Bug 1805003] Re: precision for floating number fails after 15th decimal

kenn 1805003 at bugs.launchpad.net
Sun Jan 27 12:36:27 UTC 2019


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}'

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gawk in Ubuntu.
https://bugs.launchpad.net/bugs/1805003

Title:
  precision for floating number fails after 15th decimal

Status in gawk package in Ubuntu:
  New

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`

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gawk/+bug/1805003/+subscriptions



More information about the foundations-bugs mailing list