Skip to content

Commit 09956be

Browse files
akoclaude
andcommitted
Merge branch 'bugs' (amended: Fix math examples)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents 39d93a6 + d479bfa commit 09956be

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

mdl-examples/doctype-tests/04-math-examples.mdl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ BEGIN
6767
BEGIN
6868
-- Test if current divisor divides the number evenly
6969
IF $Number mod $Divisor = 0 THEN
70-
LOG INFO NODE 'Math' 'Found divisor: {1}, not prime' WITH ({1} = $Divisor);
70+
LOG INFO NODE 'Math' 'Found divisor: {1}, not prime' WITH ({1} = toString($Divisor));
7171
SET $IsPrime = false;
7272
END IF;
7373

@@ -76,7 +76,7 @@ BEGIN
7676
END WHILE;
7777

7878
IF $IsPrime THEN
79-
LOG INFO NODE 'Math' 'Number {1} is prime' WITH ({1} = $Number);
79+
LOG INFO NODE 'Math' 'Number {1} is prime' WITH ({1} = toString($Number));
8080
END IF;
8181

8282
RETURN $IsPrime;
@@ -127,15 +127,15 @@ BEGIN
127127
DECLARE $Previous1 Long = 1;
128128
DECLARE $Current Long = 0;
129129
DECLARE $Counter Integer = 2;
130-
LOG INFO NODE 'Math' 'Calculating Fibonacci({1})' WITH ({1} = $N);
130+
LOG INFO NODE 'Math' 'Calculating Fibonacci({1})' WITH ({1} = toString($N));
131131

132132
-- Main iteration loop: Calculate F(2) through F(N)
133133
-- Uses sliding window: shift values after each calculation
134134
WHILE $Counter <= $N
135135
BEGIN
136136
-- Calculate current Fibonacci number using recurrence relation
137137
SET $Current = $Previous1 + $Previous2;
138-
LOG DEBUG NODE 'Math' 'F({1}) = {2}' WITH ({1} = $Counter, {2} = $Current);
138+
LOG DEBUG NODE 'Math' 'F({1}) = {2}' WITH ({1} = toString($Counter), {2} = toString($Current));
139139

140140
-- Slide the window: shift values for next iteration
141141
SET $Previous2 = $Previous1;
@@ -145,7 +145,7 @@ BEGIN
145145

146146
-- Store final result and return
147147
SET $Result = $Current;
148-
LOG INFO NODE 'Math' 'Fibonacci({1}) = {2}' WITH ({1} = $N, {2} = $Result);
148+
LOG INFO NODE 'Math' 'Fibonacci({1}) = {2}' WITH ({1} = toString($N), {2} = toString($Result));
149149
RETURN $Result;
150150
END;
151151
/

0 commit comments

Comments
 (0)