08-26-2010 12:50 PM
Thanks everyone. If you guys don't mind, can we stick to the while and case structure scope for now. The VI is
still not working.
It seems the false case, is also outputing its value.
08-26-2010 12:52 PM
You switched the constant going to quotient and remainder to 0 instead of 20.
08-26-2010 12:53 PM - edited 08-26-2010 12:53 PM
Take a closer look at your Quotient and Remainder function.
Edit: Is there an echo in here?
08-26-2010 12:55 PM - edited 08-26-2010 12:56 PM
Of course, this works faster
( finding all factors of an integer)
08-26-2010 01:13 PM
1 less iteration required since we know 1 and Numeric are factors we can skip that iteration and test 2 through
Floor (SQRT(ABS(Numeric)))
08-26-2010 02:06 PM
Thanks for the interesting challange- I went a step further to add this in my reuse code and added tests for perfection, primacy and squareness. The special case handling (Number = 0 or 1) made it fun to test!
Enjoy!
08-27-2010 03:23 PM
I must be getting senile...
Did I miss something along the way?
I though the original OP mentionned the following:
"I expect the results:
0
1
2
4
5
10"
How can these be factorials?
Factorials would be:
0, 1, 2, 6, 24, etc.
not
0,1,2,4,5,10..
Yes, it's Friday and I probably missed something somewhere...
08-27-2010 03:25 PM
08-27-2010 03:28 PM
@jcarmody wrote:
Factors, not factorials.
Right. But this doesn't explain why he was expecting 0. Seemed to be that he wasn't actually expecting it, since he never balked at any of our solutions.
08-27-2010 04:01 PM
@elset191 wrote:
@jcarmody wrote:
Factors, not factorials.
Right. But this doesn't explain why he was expecting 0. Seemed to be that he wasn't actually expecting it, since he never balked at any of our solutions.
<<<<<Mind reading>>>>> is better than reading posts (sometimes) Don't you wish every thread explained the end use requirement as well as this one did?