09-30-2015 12:26 AM
Hello,
I want to search in a array (double 64-bit) for a negative number/s and replace it with a zero.
Br
Solved! Go to Solution.
09-30-2015 12:28 AM
I would use In Range and Coerce and coerce the array to between 0 and +Inf.
09-30-2015 08:21 AM
If you don't like that suggestion (I personally do), you can always use the same brute force method used in every other programming language.
09-30-2015 04:02 PM
Probably the quickest option in this case 😉
09-30-2015 04:46 PM
@thoult wrote:
Probably the quickest option in this case 😉
That's clever!
I ran a benchmark on that vs the coerce method and MaxMin is about 13x faster. Kudos!
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-30-2015 04:52 PM
I was curious about the time too and found it was about 20x faster using the max min. I also found that the brute force method was about 6x faster than in range and coerce.
09-30-2015 05:02 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-30-2015 05:07 PM
Sorry, I meant that the brute force is about 2x faster than in range and coerce. And the advantage does appear to go away when using I32 datatype.