This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @:build(MyMacro.build()) class Main { | |
| public static function main() { | |
| trace(hello()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var M = 100000; | |
| var st = Date.now(); | |
| console.log(numPrimes1(M)); | |
| console.log((Date.now() - st)+" msec"); | |
| var st = Date.now(); | |
| console.log(numPrimes2(M)); | |
| console.log((Date.now() - st)+" msec"); | |
| function numPrimes1(max) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| v12 = new Scope($O412, this, false); | |
| v16 = v12.findScopeProperty($O413, 'trace', 0, $O414, true); | |
| v21 = v16.asCallProperty($O413, 'trace', 0, false, [ | |
| 'Hello World' | |
| ]); | |
| return v21; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| domain.js | |
| ApplicationDomain.prototype.executeAbc | |
| executeScript | |
| runtime.js | |
| createFunction | |
| useInterpreter = true; | |
| createCompiledFunction | |
| builder.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "mathn" | |
| # 線形合同法の周期全体にわたるシリアル相関係数 (1つ次の値との相関係数)を求める | |
| # TAOCP参照 | |
| # 「良い乗数」とされているものがとくにいい結果になるわけでもないようだ | |
| def sigma(h, k, c) | |
| if k == 1 | |
| 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://codezine.jp/article/detail/38 の移植 | |
| var VERTEX_DATA = [ | |
| [-1, 0, 0], [0, 1, 0], [0, 0, -1], | |
| [1, 0, 0], [0, 0, 1], [0, -1, 0] | |
| ]; | |
| var FACE_DATA = [ | |
| [1, 4, 2], [1, 0, 4], [1, 2, 0], [3, 2, 4], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "prime" | |
| # 参考: PARI/GPのソースコード | |
| # http://pari.math.u-bordeaux.fr/ | |
| # http://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=tree | |
| # src/basemath/arith1.cのznorder()関数 | |
| # src/basemath/gen2.cのZ_pval()関数 | |
| # ord_m(a)を求める | |
| # すなわちa^n ≡ 1 (mod m)となる最小のn≧1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def product(x, y) | |
| (a, b) = x | |
| (c, d) = y | |
| [a*c - b*d, b*c + a*d - b*d] | |
| end | |
| def conj(x) | |
| (a, b) = x | |
| [a - b, -b] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <inttypes.h> | |
| uint32_t seed = 0; | |
| double rand() { | |
| seed = seed * 1103515245 + 12345; | |
| return (double)seed / 4294967296.0; | |
| } | |
| int main() { | |
| uint32_t i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass{jsarticle} | |
| \usepackage{amsthm} | |
| \usepackage{amsmath} | |
| \usepackage{framed} | |
| \usepackage{amssymb} | |
| \usepackage{amsfonts} | |
| \setlength{\textwidth}{12cm} |