Compile-time calculation: Difference between revisions

Compile-time calculation in BASIC256
(Added solution for EDSAC)
(Compile-time calculation in BASIC256)
Line 245:
 
In both cases, the identifier <code>factorial10</code> is given the value 3628800 without any runtime calculations, although in many (or perhaps most) BASICs the first one is handled similarly to C's <code>#define</code>: if it isn't used elsewhere in the code, it doesn't appear at all in the final executable.
 
=={{header|BASIC256}}==
<syntaxhighlight lang="basic">factorial = 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10
print "10! = "; factorial # 3628800</syntaxhighlight>
 
=={{header|C}}==
2,130

edits