Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Division by zero Optimization

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110949] Division by zero Optimization
  • From: Luis <lgmendes at gmail.com>
  • Date: Tue, 13 Jul 2010 05:27:31 -0400 (EDT)

Dear all,

In order to avoid division by zero I have write the flowing simply
code :

divideWithThreoshold[ai_,bi_]:= If[bi<0.1,0,ai/bi] ;
DivideWithThreoshold[a_,b_]:= MapThread[divideWithThreoshold,{a,b}]

Since I have to apply this operation to very large lists, can give me
some suggestion how to optimize this code? Any other optimize way to
do this task?

All my best,
Luis


  • Prev by Date: Restricting file type with SystemDialogInput
  • Next by Date: Primitive Disk Gradient Fills in Graphics
  • Previous by thread: Re: Restricting file type with SystemDialogInput
  • Next by thread: Primitive Disk Gradient Fills in Graphics