[cairo] Shouldn't Cairo use/offer degrees rather than radians?

David Kastrup dak at gnu.org
Mon Jul 10 20:04:45 UTC 2017


cecashon at aol.com writes:

> Has anyone figured out a good explanation for this? I haven't been
> able to figure it out. It looks like the problem is tied to only one
> particular precision point. I don't know why that is. If I change the
> size of the surface, radius, y-point or even pi I get the same problem
> point. If I run with valgrind I get a different repetitive problem
> point.

Does valgrind link debug libraries in some manner?

> Maybe on some hardware this doesn't happen?

That's certainly quite likely since it depends on just what sin/cos do
on a minuscule scale where different FPUs will quite likely deliver
different results.

> I am testing on a Intel 32 bit Atom CPU N270 1.60GHz × 2 with
> Ubuntu16.04. This is my latest to try to figure out what is happening.

Compilers may choose to use more floating point precision than specified
for intermediate results.  That means that different GCC versions and
different optimization options might change values around.

For that reason it's important that you don't link with any different
libraries, even libraries compiled from the same source code.

-- 
David Kastrup


More information about the cairo mailing list