Re: C++Builder and Delphi Exceptions
"Rory Daulton" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <000901c35487$813c59c0$6401a8c0@laptop> |
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!"] ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Toner for Your Printer or Fax at LaserTonerSuperstore.com-Save 55%! We have your brand: HP, IBM, Canon, Xerox, Apple and many more for less! http://www.LaserTonerSuperstore.com http://us.click.yahoo.com/YmQqWC/qicGAA/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/