www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/15/04:42:17

Message-ID: <36EC5D7A.97FAC93B@geocities.com>
From: The Beyonder <beyonder69 AT geocities DOT com>
X-Mailer: Mozilla 4.51 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: sin(acos((float)i/1024))*0x10000L
References: <199903142305 DOT RAA16482 AT x15 DOT dejanews DOT com> <36EC443E DOT EFFA47B5 AT cartsys DOT com>
Lines: 70
Date: Sun, 14 Mar 1999 20:08:10 -0500
NNTP-Posting-Host: 209.5.18.203
X-Complaints-To: abuse AT sprint DOT ca
X-Trace: newscontent-02.sprint.ca 921460896 209.5.18.203 (Sun, 14 Mar 1999 20:21:36 EDT)
NNTP-Posting-Date: Sun, 14 Mar 1999 20:21:36 EDT
Organization: Sprint Canada Inc.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

OK I read the FAQ (section 11.1), but it didn't really explain anything
regarding this problem... I also tried -lm and -lemu on the linker line
(presuming that the linker line is: gcc -lm (or -lemu) foo1.cc foo2.a -o
foo.exe but this didn't work.  Also you weren't very clear on if it was
the function's (acos) or emulator's fault...  on a seperate note, just
to get things rolling for now how would I go about making my own acos
function? is it hard?

Nate Eldredge wrote:
> 
> The Beyonder <beyonder69 AT geocities DOT com> 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

-- 
**********************************************************************
* Sahab Yazdani              * OpenDOS - Why go through windows when *
* Thornhill Secondary School *     you could have a !&$^&* DOOR?     *
**********************************************************************
* http://www.geocities.com/TimesSquare/Bunker/8994/index.html * >:-P *
*     Click the link to visit my portion of The Neverhood     * <:-D *
**********************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019