2
$\begingroup$

After running a very long loop, I get the following result given by a very long vector:

{1.9*10^-41 Null^1415, 1.9*10^-41 Null^1414, 2.0*10^-41 Null^1413, 
 2.1*10^-41 Null^1412, 2.1*10^-41 Null^1411, 2.2*10^-41 Null^1410, 
 2.2*10^-41 Null^1409, 2.3*10^-41 Null^1408, 2.3*10^-41 Null^1407, 
 2.4*10^-41 Null^1406, 2.5*10^-41 Null^1405, 2.5*10^-41 Null^1404, 
 2.6*10^-41 Null^1403, 2.7*10^-41 Null^1402, 2.7*10^-41 Null^1401, 
 2.8*10^-41 Null^1400, 2.6*10^-41 Null^1399, 2.6*10^-41 Null^1398, 
 2.7*10^-41 Null^1397, 2.8*10^-41 Null^1396, 2.8*10^-41 Null^1395, 
 2.9*10^-41 Null^1394, 3.0*10^-41 Null^1393, 3.1*10^-41 Null^1392, 
 3.2*10^-41 Null^1391, 3.3*10^-41 Null^1390, 3.3*10^-41 Null^1389, 
 3.4*10^-41 Null^1388, 3.5*10^-41 Null^1387, 3.6*10^-41 Null^1386, 
 3.7*10^-41 Null^1385, 3.8*10^-41 Null^1384, 3.9*10^-41 Null^1383, 
 4.0*10^-41 Null^1382, 4.1*10^-41 Null^1381, 4.3*10^-41 Null^1380, 
 4.4*10^-41 Null^1379, 4.5*10^-41 Null^1378, 4.6*10^-41 Null^1377, 
 4.7*10^-41 Null^1376, 4.9*10^-41 Null^1375, 5.0*10^-41 Null^1374, 
 5.1*10^-41 Null^1373, 5.3*10^-41 Null^1372, 4.7*10^-41 Null^1371, 
 4.9*10^-41 Null^1370, 5.0*10^-41 Null^1369, 5.1*10^-41 Null^1368, 
 5.3*10^-41 Null^1367, 5.4*10^-41 Null^1366, 5.6*10^-41 Null^1365, 
 5.7*10^-41 Null^1364, 5.9*10^-41 Null^1363, 6.1*10^-41 Null^1362, 
,...} 

This vector in any component has the following form:

$$\text{number}_1\times\text{Null}^{\text{number}_2}$$ I want to leave the vector only with components containing $\text{number}_1$ and not $\text{Null}^{\text{number}_2}$ What is the best way to delete these strange Null factors from every component?

$\endgroup$
5
  • 5
    $\begingroup$ Ulrich has given an answer to remove the Nulls. I don't know what calculations you made to get the list above, but the presence of all the Nulls suggests that you might re-visit the calculation and find out where they are coming from. Unwanted Nulls may be a symptom of some underlying issue, especially with numbers being so tiny (10^-40) and the power of the Nulls being so large. $\endgroup$
    – bill s
    Jan 5 at 14:20
  • 1
    $\begingroup$ Out of curiosity, what made you think that this question is even remotely related to bugs? $\endgroup$
    – bmf
    Jan 5 at 14:31
  • $\begingroup$ @bmf what is the difference between bugs and just ordinary problems? $\endgroup$ Jan 5 at 14:37
  • 2
    $\begingroup$ @DanielVainshtein When we say bugs we mean that some built-in command is not working as advertised on the official documentation site. Or some command does not provide an expected result. There are descriptions of these matters, here on the site. $\endgroup$
    – bmf
    Jan 5 at 15:08
  • 1
    $\begingroup$ You have probably put a semicolon in somewhere earlier where you shouldn't have (or should have used Return). For example define f[a_] := Module[{}, a^2;] and then do x = 100*f[2] and you'll get 100 Null instead of the expected 400. $\endgroup$
    – flinty
    Jan 5 at 17:08

1 Answer 1

5
$\begingroup$

Try

list={1.9*10^-41 Null^1415, 1.9*10^-41 Null^1414, 2.0*10^-41 Null^1413, 
 2.1*10^-41 Null^1412, 2.1*10^-41 Null^1411, 2.2*10^-41 Null^1410, 
 2.2*10^-41 Null^1409, 2.3*10^-41 Null^1408, 2.3*10^-41 Null^1407, 
 2.4*10^-41 Null^1406, 2.5*10^-41 Null^1405, 2.5*10^-41 Null^1404, 
 2.6*10^-41 Null^1403, 2.7*10^-41 Null^1402, 2.7*10^-41 Null^1401, 
 2.8*10^-41 Null^1400, 2.6*10^-41 Null^1399, 2.6*10^-41 Null^1398, 
 2.7*10^-41 Null^1397, 2.8*10^-41 Null^1396, 2.8*10^-41 Null^1395, 
 2.9*10^-41 Null^1394, 3.0*10^-41 Null^1393, 3.1*10^-41 Null^1392, 
 3.2*10^-41 Null^1391, 3.3*10^-41 Null^1390, 3.3*10^-41 Null^1389, 
 3.4*10^-41 Null^1388, 3.5*10^-41 Null^1387, 3.6*10^-41 Null^1386, 
 3.7*10^-41 Null^1385, 3.8*10^-41 Null^1384, 3.9*10^-41 Null^1383, 
 4.0*10^-41 Null^1382, 4.1*10^-41 Null^1381, 4.3*10^-41 Null^1380, 
 4.4*10^-41 Null^1379, 4.5*10^-41 Null^1378, 4.6*10^-41 Null^1377, 
 4.7*10^-41 Null^1376, 4.9*10^-41 Null^1375, 5.0*10^-41 Null^1374, 
 5.1*10^-41 Null^1373, 5.3*10^-41 Null^1372, 4.7*10^-41 Null^1371, 
 4.9*10^-41 Null^1370, 5.0*10^-41 Null^1369, 5.1*10^-41 Null^1368, 
 5.3*10^-41 Null^1367, 5.4*10^-41 Null^1366, 5.6*10^-41 Null^1365, 
 5.7*10^-41 Null^1364, 5.9*10^-41 Null^1363, 6.1*10^-41 Null^1362 }

list /. Null^b_ -> 1

or

list /. Null  -> 1
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.