Cody

Problem 2250. Given a number find two variables

Solution 1992678

Submitted on 27 Oct 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 10; y_correct = [0.625 4]; assert(isequal(extract(x),y_correct))

i = 0 a = 10 i = 1 a = 5 i = 2 a = 2.5000 i = 3 a = 1.2500 i = 4 i = 4

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test1 (line 3) assert(isequal(extract(x),y_correct))

2   Fail
x = 3.1416; y_correct = [0.7854 2]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

i = 0 a = 3.1416 i = 1 a = 1.5708 i = 2 i = 2

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test2 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

3   Fail
x = -3; y_correct = [-0.7500 2]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

i = 0 i = 0

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test3 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

4   Fail
x = realmax('single'); y_correct = [1 128]; assert( abs(sum(extract(x) - y_correct)) < 0.0001)

i = 0 a = single 3.4028e+38 i = 1 a = single 1.7014e+38 i = 2 a = single 8.5071e+37 i = 3 a = single 4.2535e+37 i = 4 a = single 2.1268e+37 i = 5 a = single 1.0634e+37 i = 6 a = single 5.3169e+36 i = 7 a = single 2.6585e+36 i = 8 a = single 1.3292e+36 i = 9 a = single 6.6461e+35 i = 10 a = single 3.3231e+35 i = 11 a = single 1.6615e+35 i = 12 a = single 8.3077e+34 i = 13 a = single 4.1538e+34 i = 14 a = single 2.0769e+34 i = 15 a = single 1.0385e+34 i = 16 a = single 5.1923e+33 i = 17 a = single 2.5961e+33 i = 18 a = single 1.2981e+33 i = 19 a = single 6.4904e+32 i = 20 a = single 3.2452e+32 i = 21 a = single 1.6226e+32 i = 22 a = single 8.1130e+31 i = 23 a = single 4.0565e+31 i = 24 a = single 2.0282e+31 i = 25 a = single 1.0141e+31 i = 26 a = single 5.0706e+30 i = 27 a = single 2.5353e+30 i = 28 a = single 1.2677e+30 i = 29 a = single 6.3383e+29 i = 30 a = single 3.1691e+29 i = 31 a = single 1.5846e+29 i = 32 a = single 7.9228e+28 i = 33 a = single 3.9614e+28 i = 34 a = single 1.9807e+28 i = 35 a = single 9.9035e+27 i = 36 a = single 4.9518e+27 i = 37 a = single 2.4759e+27 i = 38 a = single 1.2379e+27 i = 39 a = single 6.1897e+26 i = 40 a = single 3.0948e+26 i = 41 a = single 1.5474e+26 i = 42 a = single 7.7371e+25 i = 43 a = single 3.8686e+25 i = 44 a = single 1.9343e+25 i = 45 a = single 9.6714e+24 i = 46 a = single 4.8357e+24 i = 47 a = single 2.4179e+24 i = 48 a = single 1.2089e+24 i = 49 a = single 6.0446e+23 i = 50 a = single 3.0223e+23 i = 51 a = single 1.5112e+23 i = 52 a = single 7.5558e+22 i = 53 a = single 3.7779e+22 i = 54 a = single 1.8889e+22 i = 55 a = single 9.4447e+21 i = 56 a = single 4.7224e+21 i = 57 a = single 2.3612e+21 i = 58 a = single 1.1806e+21 i = 59 a = single 5.9030e+20 i = 60 a = single 2.9515e+20 i = 61 a = single 1.4757e+20 i = 62 a = single 7.3787e+19 i = 63 a = single 3.6893e+19 i = 64 a = single 1.8447e+19 i = 65 a = single 9.2234e+18 i = 66 a = single 4.6117e+18 i = 67 a = single 2.3058e+18 i = 68 a = single 1.1529e+18 i = 69 a = single 5.7646e+17 i = 70 a = single 2.8823e+17 i = 71 a = single 1.4412e+17 i = 72 a = single 7.2058e+16 i = 73 a = single 3.6029e+16 i = 74 a = single 1.8014e+16 i = 75 a = single 9.0072e+15 i = 76 a = single 4.5036e+15 i = 77 a = single 2.2518e+15 i = 78 a = single 1.1259e+15 i = 79 a = single 5.6295e+14 i = 80 a = single 2.8147e+14 i = 81 a = single 1.4074e+14 i = 82 a = single 7.0369e+13 i = 83 a = single 3.5184e+13 i = 84 a = single 1.7592e+13 i = 85 a = single 8.7961e+12 i = 86 a = single 4.3980e+12 i = 87 a = single 2.1990e+12 i = 88 a = single 1.0995e+12 i = 89 a = single 5.4976e+11 i = 90 a = single 2.7488e+11 i = 91 a = single 1.3744e+11 i = 92 a = single 6.8719e+10 i = 93 a = single 3.4360e+10 i = 94 a = single 1.7180e+10 i = 95 a = single 8.5899e+09 i = 96 a = single 4.2950e+09 i = 97 a = single 2.1475e+09 i = 98 a = single 1.0737e+09 i = 99 a = single 536870880 i = 100 a = single 268435440 i = 101 a = single 134217720 i = 102 a = single 67108860 i = 103 a = single 33554430 i = 104 a = single 16777215 i = 105 a = single 8.3886e+06 i = 106 a = single 4.1943e+06 i = 107 a = single 2.0972e+06 i = 108 a = single 1.0486e+06 i = 109 a = single 5.2429e+05 i = 110 a = single 2.6214e+05 i = 111 a = single 1.3107e+05 i = 112 a = single 6.5536e+04 i = 113 a = single 3.2768e+04 i = 114 a = single 1.6384e+04 i = 115 a = single 8.1920e+03 i = 116 a = single 4.0960e+03 i = 117 a = single 2.0480e+03 i = 118 a = single 1.0240e+03 i = 119 a = single 512.0000 i = 120 a = single 256.0000 i = 121 a = single 128.0000 i = 122 a = single 64.0000 i = 123 a = single 32.0000 i = 124 a = single 16.0000 i = 125 a = single 8.0000 i = 126 a = single 4.0000 i = 127 a = single 2.0000 i = 128 i = 128

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test4 (line 3) assert( abs(sum(extract(x) - y_correct)) < 0.0001)

5   Fail
x = 0; y_correct = [0 0]; assert(isequal(extract(x),y_correct))

i = 0 i = 0

Output argument "y_correct" (and maybe others) not assigned during call to "extract". Error in Test5 (line 3) assert(isequal(extract(x),y_correct))