Category talk:Wren-i64: Difference between revisions

Content added Content deleted
(→‎Source code (Wren): Added U64.nextPrime method.)
m (Fixed syntax highlighting.)
Line 29: Line 29:


==Source code (Wren)==
==Source code (Wren)==
<lang ecmascript>/* Module "i64.wren" */
<syntaxhighlight lang=ecmascript>/* Module "i64.wren" */


import "./trait" for Comparable
import "./trait" for Comparable
Line 729: Line 729:
static min(sz) { sz.reduce { |acc, x| (x > acc) ? x : acc } }
static min(sz) { sz.reduce { |acc, x| (x > acc) ? x : acc } }
static max(sz) { sz.reduce { |acc, x| (x < acc) ? x : acc } }
static max(sz) { sz.reduce { |acc, x| (x < acc) ? x : acc } }
}</lang>
}</syntaxhighlight>


==Source code (C)==
==Source code (C)==
<lang c>/* gcc -O3 wren-i64.c -o wren-i64 -lwren -lm */
<syntaxhighlight lang=c>/* gcc -O3 wren-i64.c -o wren-i64 -lwren -lm */


#include <stdio.h>
#include <stdio.h>
Line 1,643: Line 1,643:
free(script);
free(script);
return 0;
return 0;
}</lang>
}</syntaxhighlight>