On 03/06/2015 10:04 AM, Rustom Mody wrote:
> On Friday, March 6, 2015 at 10:29:19 PM UTC+5:30, Steven D'Aprano wrote:

>> def inverse(x):
>>     return 1.0/x
>>
>> There's an exception there, waiting to bite. If I include inverse() in some
>> complex calculation:
>>
>> def function(x, y):
>>     return atan2(inverse(3*x*y)+1, inverse(1 - x**2 + 3*x - 0.2)**3)
>>
>> values = [function(1.5*x, y+2) for x, y in zip(xx, yy)]

> Ok... Maybe so
> As I said I am not too sure about this
> 
> However you have to give me a little fuller (if not more realistic) example
> [Your xx and yy are what?]

xx and yy are lists of floats, and for your test xx should have at least one 
zero in it.

> And I have to see if I know how to tweak it nan-less
> And at least maintain hopefully improve the clarity, succinctness of the 
> original!  Not saying I will be able -- just that thats the claim

Good luck.  :)

--
~Ethan~

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to