diff --git a/tests/DNS/test_scaling.py b/tests/DNS/test_scaling.py
index 5cbff34aab4dd5e598ad9382260463ce5193ff23..9ba25e38117921c073d527c26f3ae95c0bd05bbf 100644
--- a/tests/DNS/test_scaling.py
+++ b/tests/DNS/test_scaling.py
@@ -27,9 +27,10 @@ def get_DNS_parameters(
         simname = DNS_type + simname
     class_name = 'NSVE'
     if DNS_type != 'A':
+        exponent = int(np.log10(nparticles))
         simname += 'p{0}e{1}'.format(
-                int(nparticles / 10**np.log10(nparticles)),
-                int(np.log10(nparticles)))
+                int(nparticles / 10**exponent),
+                exponent)
         class_name += 'particles'
     work_dir = 'nn{0:0>4d}np{1}'.format(nnodes, nprocesses)
     if not output_on: