From: Faheem M. <fa...@fa...> - 2012-05-31 08:31:53
|
Hi Stephan, Thanks for your reply. On Thu, 31 May 2012, cri...@cs... wrote: > Hi Fareen, > > the (the double-float ...) tells the compiler that you insist that the > result is a double-float; though you may lie to the compiler if x assumes > non-appropriate values for this declaration. > > I see in the Stackoverflow thread that you want to declrare x as beaing a > d-f >= 0.0. If this is the case than you can try: > > (declare (type (double-float 0.0 *) x)) If this declaration says that x is a double float which is greater than or equal to 0, then that seems like a good way to resolve the problem. Can you give me a reference for this syntax? Thanks. > Then you should also be able to remove the (the double-float ...) since > the compiler should be able to infer that the result can only be a > double-float. Furthermore you will get automatically a type/range-check > for the correct values of x. Oh, the compiler will automatically put in a runtime check that x >= 0? Interesting. > Hope this helps. Yes, thanks. > Best regards, > Stephan Regards, Faheem. |