Re: C++Builder and Delphi Exceptions

mihai oltean <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Dear Rory,

I want as the BCB to return zero for values larger
than 1E19 or less than 1E-19. If you could write such
things for me it would be great.

I don't know if are there other functions which return
NAN but I'll tell you as soon as I know.

Thank you,
Mihai


> NAN.
--- Rory Daulton <[email protected]> wrote:
> Mihai,
> 
> > It seems that NAN is generated by the sin or cos
> > functions which theoretically take a double as a
> > parameter but if the value is larger than 1E20
> they
> > (sin and cos) return a NAN.
> 
> Aha!  I knew the key was to find where the NANs were
> coming from.
> 
> In Delphi, Sin() and Cos() return zero for
> parameters larger than about
> 1E19.  It seems that BCB does differently and
> returns NAN.  This is
> understandable, since the Double type cannot store
> 1E19 or above exactly, so
> Sin() and Cos() values would be meaningless for such
> large values.  (It's a
> precision issue).  So, the Intel FPU basically
> ignores those values, and the
> programming environment must decide how to handle
> the situation.
> 
> So you do not want the BCB standard of returning
> NAN.  Just what do you want
> to be returned for such values: zero (as in Delphi),
> NAN (as in BCB), or an
> exception (as in ESB Professional Computation
> Suite)?  Let me know, and I
> can quickly write an asm routine (assembler embedded
> in Delphi) to do that.
> You could easily modify it to work in BCB.
> 
> Is there any other way that NANs are entering your
> program?  I may be able
> to help with that also.
> 
> Rory Daulton
> [email protected]
> Campus Crusade for Christ
> 
> 
> ---
> [This E-mail scanned for viruses by Declude Virus
> and Nmax "Your MAXimum Connection!"]
> [This E-mail scanned for spam by Declude JunkMail
> and Nmax "Your MAXimum Connection!"] 
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.