From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Sun, 02 Oct 2011 18:38:00 +0200." <20111002163800.GA12773@polynum.com> References: <20111002163800.GA12773@polynum.com> Date: Sun, 2 Oct 2011 10:52:27 -0700 From: Bakul Shah Message-Id: <20111002175227.2D7F1B856@mail.bitblocks.com> Subject: Re: [9fans] circular fonctions: precision? Topicbox-Message-UUID: 2f45cc2a-ead7-11e9-9d60-3106f5b1d025 On Sun, 02 Oct 2011 18:38:00 +0200 tlaronde@polynum.com wrote: > Hello, > > Is there some documentation about the precision of the circular (i.e > trigonometric) fonctions, depending on the (plan9) implementation and > the hardware? Do you mean precision (number of significant bits) or accuracy (closeness to true value)? For a double the precision is 52 bits, for a float 23. > To my limited knowledge, an OS is integer based, so the floating > point support is mainly "user space" and is, despite IEEE754 and due to > the interaction between hardware, software, and programmer, really > floating, but is there a range given for the association of OS/hardware > telling that say sin(r) or asin(s) is accurate, at worst, at some > epsilon near? It depends on the algorithm used, not on the OS. The C standard leaves accuracy upto the implementation. If you care, you can compare the result of a C function with what bc(1) computes for the same function (by using a suitably large scale).