Babbage problem: Difference between revisions

→‎{{header|VBScript}}: Added Vedit macro language
imported>Maxima enthusiast
No edit summary
imported>PauliKL
(→‎{{header|VBScript}}: Added Vedit macro language)
Line 4,692:
<pre>The smallest positive integer whose square ends in 269696 is 25264.
Its square is 638269696.</pre>
 
=={{header|Vedit macro language}}==
<syntaxhighlight lang="vedit">
// Vedit Macro Language stores numerical values in numeric registers,
// referred as #0 to #255.
 
// Check all positive integer values until the required value found
for (#1 = 1; #1 < MAXNUM; #1++) {
 
#2 = #1 * #1 // #2 = square of the value
 
// The operator % is the modulo operator (the remainder of division).
// Modulo 1000000 gives the last 6 digits of a value.
#3 = #2 % 1000000
 
if (#3 == 269696) {
break // We found it, lets stop here
}
}
 
if (#1 < MAXNUM) {
Message("The smallest number whose square ends in 269696 is ", NOCR)
Num_Type(#1)
Message("The square is ", NOCR)
Num_Type(#2)
} else {
Message("Condition not satisfied before MAXNUM reached.)
}
</syntaxhighlight>
{{Out}}
<pre>The smallest number whose square ends in 269696 is 25264
The square is 638269696</pre>
 
=={{header|Verilog}}==
Anonymous user