←Older revision |
Revision as of 04:31, 14 May 2014 |
Line 56: |
Line 56: |
| --[htttp://www.dlisted.com/node/29432 swv] 00:19, 10 April 2009 (CEST) | | --[htttp://www.dlisted.com/node/29432 swv] 00:19, 10 April 2009 (CEST) |
| </div> | | </div> |
- | == Rohaifa said ... == | + | == Eugene said ... == |
| | | |
| <div class='commentBlock'> | | <div class='commentBlock'> |
- | 実用性はさておきboost::mpl::identifyでそのようなことが可能です こちらは型が先になりますが void f(int, dbuloe);identity<void (*)(int, dbuloe)>::type p1 = g; // void (*p1)(int, dbuloe) = g;identity<void (int, dbuloe)>::type* p2 = g; // p1と同じ型typedef identity<void (*)(int, dbuloe)>::type ptr_f_t; // typedefにも使用可能
| + | new Factorial().sumRange(1, n); it's not a n! |
| | | |
- | --Rohaifa 17:53, 21 October 2013 (CEST) | + | --Eugene 12:12, 11 May 2014 (CEST) |
- | </div>
| + | |
- | == Gallant said ... ==
| + | |
| | | |
- | <div class='commentBlock'>
| + | How comes!? At least we know it is n! for 3, 4, 5, see the [http://source.apidesign.org/hg/apidesign/file/e1439046d96e/samples/composition/src-test/org/apidesign/math/test/FactorialTest.java#l30 FactorialTest]: |
- | Hello Michael,I was wondering if there will be a reapet of the above workshop in the near future, as I will be unable to attend. Also, I'd like to commend you on your awesome blog concise and well-written!
| + | |
| | | |
- | --Gallant 13:50, 23 October 2013 (CEST)
| + | <source lang="java"> |
- | </div>
| + | public void testFactorial3() { |
- | == Eugene said ... ==
| + | assertEquals(6, Factorial.factorial(3)); |
| + | } |
| + | |
| + | public void testFactorial4() { |
| + | assertEquals(24, Factorial.factorial(4)); |
| + | } |
| + | |
| + | public void testFactorial5() { |
| + | assertEquals(120, Factorial.factorial(5)); |
| + | } |
| + | </source> |
| | | |
- | <div class='commentBlock'>
| + | of course your comment brings deeper question: How do we know our software is correct? We don't we just know it is correct for envisioned use cases (e.g. 3, 4, 5). |
- | new Factorial().sumRange(1, n); it's not a n!
| + | |
| + | --[[User:JaroslavTulach|JaroslavTulach]] 04:31, 14 May 2014 (UTC) |
| | | |
- | --Eugene 12:12, 11 May 2014 (CEST)
| |
| </div> | | </div> |