Unix Shell - Re: precision of bc

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > November 2006 > Re: precision of bc





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: precision of bc
Daniel Rock

2006-11-26, 7:18 pm

Michael Paoli <michael1cat@yahoo.com> wrote:
> That's a nice theory, but may implementations of bc(1) are fairly
> limited in their precision - and well before CPU or memory become the
> practical limiting factors. I've seen many bc(1) implementations that
> bomb out (typically core dumping) somewhere in the range of 20 to 55
> for scale. E.g. try:
> $ echo 'scale=60;4*a(1)' | bc -l
> on some various implementations and see what you get. There are many
> that can't handle that.


Then this bc is broken. According to POSIX/SUSv3 bc has to support at
least a scale of 99:

http://www.opengroup.org/onlinepubs...s/limits.h.html

(see BC_SCALE_MAX, resp. _POSIX2_BC_SCALE_MAX)

--
Daniel
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com