Sender: nate AT cartsys DOT com Message-ID: <36EC443E.EFFA47B5@cartsys.com> Date: Sun, 14 Mar 1999 15:20:30 -0800 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.3 i586) MIME-Version: 1.0 To: djgpp AT delorie DOT com CC: djgpp-workers AT delorie DOT com Subject: Re: sin(acos((float)i/1024))*0x10000L References: <199903142305 DOT RAA16482 AT x15 DOT dejanews DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com The Beyonder wrote: > Hi Y'all, > after visiting a site on how to draw primitive shapes to the screen, I > decided to try this circle technique. It said to first generate a > trigonomitry table full of sin_acos info? So I copied his source code: [snip] > Now during compilation it just gets stuck on "Generating Tri table...". > SIN alone works, and so does COS... but ACOS alone just stalls (I can > quit using CTRL-C). > > Is it ACOS or my programming? This appears to be a bug in the FPU emulation. I can reproduce it on an FPU-less machine; any call to `acos' appears to enter some kind of infinite loop. I hit Ctrl-Break and was rewarded with this traceback (here symified): Exiting due to signal SIGINT Control-Break Pressed at eip=00092d6b eax=01000400 ebx=ffff8000 ecx=01000400 edx=00000000 esi=ffff8000 edi=ffffc000 ebp=0008f238 esp=0008f1ec program=A:\ACOS-TES.EXE cs: sel=00a7 base=10000000 limit=0009ffff ds: sel=00af base=10000000 limit=0009ffff es: sel=00af base=10000000 limit=0009ffff fs: sel=008f base=0000fdb0 limit=0000ffff gs: sel=00bf base=00000000 limit=0010ffff ss: sel=00af base=10000000 limit=0009ffff App stack: [0008f308..0000f308] Exceptn stack: [0000f1f0..0000d2b0] Call frame traceback EIPs: 0x00092d6b 0x92d6b 0x00093213 0x93213 0x0009524b 0x9524b 0x0000269c ___frame_state_for+328 0x000041b3 _raise+99 0x000041fa ___djgpp_exception_processor+26 0x00000001 0x1 0x00002d3a ___crt1_startup+174 Looks somewhat unusual. To the original poster: As a workaround, add `-lm' to your link command line. This uses a different implementation of the math functions that seems to work better. You might also try installing WMEMU (I didn't try this); see FAQ section 11.1. -- Nate Eldredge nate AT cartsys DOT com