Oka Laboratory

Fraction!

分数のためのオブジェクト (object) (クラス (class)) です。計算結果を様々な書式で出力することができます。

分数計算

分数計算オブジェクトの動作を確認できます。

分数1 : f1 = new Fraction();
分数2 : f2 = new Fraction();

出力形式 f1 f2 result
toString()
toString(true)
nutString()
nutString(true)
diagString()
diagString(true)
valueOf()
toJapanNumeral()
toJapanNumeral(true)
toPercentage(3)
toContinuedString()
toRepeatingString()
toRatioString()
toRatioString('1:N')
toRatioString('N:1')

利用上の注意

コンストラクタ

new演算子を使ってインスタンス (実体, instance) を生成します。引数の個数並びに型により分数の形式を判別し、分子/分母の形に変換しています。

真分数 (proper fraction)・仮分数 (improper fraction)
構文
new Fraction(a, b)
引数
a
分子 (numerator)
b
分母 (denominator) (0以外の実数)
戻り値
分数インスタンス
帯分数 (mixed fraction / mixed number)
構文
new Fraction(a, b, c)
引数
a
整数部 (whole)
b
分子 (numerator)
c
分母 (denominator) (0以外の実数)
戻り値
分数インスタンス
実数 (real number)
構文
new Fraction(a)
引数
a
実数
戻り値
分数インスタンス
循環小数 (repeating decimal)
構文
new Fraction(a)
引数
a
循環節を丸括弧 () で括った循環小数 '整数部.非循環部(循環節)'
戻り値
分数インスタンス
連分数 (continued fraction)
構文
new Fraction(a)
引数
a
連分数の数列表記 () の文字列 '[整数; 自然数, 自然数, …]'
戻り値
分数インスタンス

分子・分母とも整数だけではなく小数の入力も可能ですが、分母に0を設定することはできません。

オブジェクト内では生成時に設定された値を既約分数 (irreducible fraction) として保持し、四則演算メソッドを実行しても変更されません。。

function Fraction(a, b, c) {
/* コンストラクタ関数 (constructor function) */
	var num, denom;

	if (!(this instanceof Fraction)) {
	// thisがFractionのインスタンスでない場合はnew演算子でコンストラクタを呼出
		return new Fraction(a, b, c);
	}

	if (c !== undefined) {
	// 帯分数 a b/c ⇒ Fraction(a, b, c)
		if (c === 0) throw new Error('分母に0は指定できません。Denominator cannot be zero.');
		if (a >= 0) {
			num = a * c + b;
		} else {
			num = a * c - b;
		}
		denom = c;
	} else if (b !== undefined) {
	// 真分数 or 仮分数 a/b ⇒ Fraction(a, b)
		num = a;
		denom = b;
	} else if ((typeof a === 'number') && (isFinite(a))) {
	// 整数 or 小数 a ⇒ Fraction(a, 1)
		num = a;
		denom = 1;
	} else {
	// 文字列型のときは循環小数 / 連分数として処理
		if (a.indexOf('[') === 0) {
		// 連分数 (先頭の文字が'[')
			var f = Fraction.continued_convergent(Fraction.from_continued_sequence(a)).slice(-1)[0];	// 近似分数配列の最後の要素を取得
		} else {
		// 循環小数
			var f = Fraction.from_repeating_decimal(a);
		}
		num = f.num;
		denom = f.denom;
	}
	if (denom === 0) throw new Error('分母に0は指定できません。Denominator cannot be zero.');

	var num_places = Fraction.get_decimal_places(num);
	var denom_places = Fraction.get_decimal_places(denom);
	var max_places = Math.max(num_places, denom_places);
	if (max_places > 0) {
		var factor = Fraction.ipow(10, max_places);
		num = Math.round(num * factor);
		denom = Math.round(denom * factor);
	}

	this.num = num;
	this.denom = denom;
	this._fix_sign();

	// 約分
	this._reduce();
}

// 計算結果の一時保持(使い回し)用グローバルインスタンス
Fraction.RESULT_POOL = new Fraction(1, 1);

四則演算

四則演算 (four arithmetic operations) は以下のインスタンスメソッドで実行します。オブジェクトが保持している値に引数の分数を適用して計算し、その結果を分数で返します。

加法 (addition)
機能
保持している値を被加数 (augend)、flaction を加数 (addend) として加算します。
構文
add(flaction, target)
引数
flaction
分数オブジェクト
target
計算結果を格納する Fraction インスタンス (省略可)
戻り値
計算結果 (下記参照)
計算式
n1d1+n2d2 = n1⁢d2d1⁢d2+n2⁢d1d1⁢d2 = n1⁢d2+n2⁢d1d1⁢d2
減法 (subtraction )
機能
保持している値を被減数 (minuend)、flaction を減数 (subtrahend) として減算します。
構文
sub(flaction, target)
引数
flaction
分数オブジェクト
target
計算結果を格納する Fraction インスタンス (省略可)
戻り値
計算結果 (下記参照)
計算式
n1d1−n2d2 = n1⁢d2d1⁢d2−n2⁢d1d1⁢d2 = n1⁢d2−n2⁢d1d1⁢d2
乗法 (multiplication)
機能
保持している値を被乗数 (multiplicand)、flaction を乗数 (multiplier) として乗算します。
構文
mul(flaction, target)
引数
flaction
分数オブジェクト
target
計算結果を格納する Fraction インスタンス (省略可)
戻り値
計算結果 (下記参照)
計算式
n1d1×n2d2 = n1⁢n2d1⁢d2
除法 (division)
機能
保持している値を被除数 (dividend)、flaction を除数 (divisor) として除算します。
構文
div(flaction, target)
引数
flaction
分数オブジェクト
target
計算結果を格納する Fraction インスタンス (省略可)
戻り値
計算結果 (下記参照)
計算式
n1d1÷n2d2 = n1d1×d2n2 = n1⁢d2d1⁢n2

引数 target を指定したときは、計算結果を指定された Fraction インスタンスの分子 num と分母 denom に直接格納し戻り値として返します。計算結果をあとで使う場合は、ver result = new Fraction(); f1.add(f2, result); のように専用の格納先インスタンスを指定します。

一方、target の指定を省略したときは一時保持用インスタンス Fraction.RESULT_POOL に計算結果を格納し戻り値として返します。このため、var res1 = f1.add(f2) の後に var res2 = f3.mul(f4) を実行すると res1 と res2 は同じ Fraction.RESULT_POOL の値を参照しているため、res1 の値まで f3 × f4 の結果に書き換わってしまいます。

この仕様は、計算ごとに new Fraction を行わないようにしてメモリ確保とガベージコレクション (garbage collection: GC) の負荷をゼロに抑えるためのテクニックです。

Fraction.prototype.add = function(fraction, target) {
/* 加法 (addition) */
	var output = target || Fraction.RESULT_POOL;
	var new_num = (this.num * fraction.denom) + (fraction.num * this.denom);
	var new_denom = this.denom * fraction.denom;
	output.num = new_num;
	output.denom = new_denom;
	output._fix_sign();
	output._reduce();
	return output;
};

Fraction.prototype.sub = function(fraction, target) {
/* 減法 (subtraction) */
	var output = target || Fraction.RESULT_POOL;
	var new_num = (this.num * fraction.denom) - (fraction.num * this.denom);
	var new_denom = this.denom * fraction.denom;
	output.num = new_num;
	output.denom = new_denom;
	output._fix_sign();
	output._reduce();
	return output;
};

Fraction.prototype.mul = function(fraction, target) {
/* 乗法 (multiplication) */
	var output = target || Fraction.RESULT_POOL;
	var new_num = this.num * fraction.num;
	var new_denom = this.denom * fraction.denom;
	output.num = new_num;
	output.denom = new_denom;
	output._fix_sign();
	output._reduce();
	return output;
};

Fraction.prototype.div = function(fraction, target) {
/* 除法 (division) */
	var output = target || Fraction.RESULT_POOL;
	var new_num = this.num * fraction.denom
	var new_denom = this.denom * fraction.num;
	output.num = new_num;
	output.denom = new_denom;
	output._fix_sign();
	output._reduce();
	return output;
};

出力

オブジェクト内で保持している分数を様々な書式で出力するインスタンスメソッドです。実際の動作は分数計算の結果で確認できます。

toString

機能
横型分数 (horizontal fraction) 表記にします。
構文
toString(mixed)
引数
mixed
trueで帯分数、省略若しくはfalseで真分数・仮分数
戻り値
横型分数の文字列
Fraction.prototype.toString = function(mixed) {
/* 横型分数 (horizontal fraction) 表記 */
	mixed = mixed || false;
	var whole = 0;
	var num = Math.abs(this.num);
	var sign = this.num < 0 ? '-' : '';
	var str;
	if (num < this.denom) mixed = false;	// 分子<分母のときは帯分数modeを強制解除

	if (mixed) {
		var m = this._convert_to_mixed();
		whole = m.whole;
		num = m.remainder;
		sign = m.sign;
	}
	if (this.denom === 1) {
		str = this.num.toString();
	} else {
		str = sign;
		if (whole > 0) str += whole;	// 帯分数の整数部
		if (num > 0) {
			if (whole > 0) str += '_';	// 帯分数
			str += num;
			str += '/';
			str += this.denom;
		}
	}
	return str;
};

nutString

機能
縦積み分数 (nut fraction) で表記します。
構文
nutString(mixed)
引数
mixed
trueで帯分数、省略若しくはfalseで真分数・仮分数
戻り値
MathML (Mathematical Markup Language) で表した縦積み分数
制限事項
MathMLに対応していない環境では表示できません。
Fraction.prototype.nutString = function(mixed) {
/* 縦積み分数 (nut fraction) 表記 (MathML使用) */
	mixed = mixed || false;
	var whole = 0;
	var num = Math.abs(this.num);
	var sign = this.num < 0 ? '&minus;' : '';
	if (num < this.denom) mixed = false;	// 分子<分母のときは帯分数modeを強制解除
	var str = '<math>';
	if (mixed) {
		var m = this._convert_to_mixed();
		whole = m.whole;
		num = m.remainder;
		sign = m.sign;
	}
	if (this.denom === 1) {
		str += '<mn>';
		str += this.num.toString();
		str += '</mn>';
	} else {
		str += '<mo>' + sign + '</mo>';
		if (whole > 0) {
		// 帯分数の整数部
			str +='<mn>';
			str += whole;
			str += '</mn>';
		}
		if (num > 0) {
			if (whole > 0) str += '<mo>&#x2064;</mo>';	// 帯分数
			str += '<mfrac><mn>';
			str += num;
			str += '</mn><mn>';
			str += this.denom;
			str += '</mn></mfrac>';
		}
	}
	str += '</math>';
	return str;
};

diagString

機能
diagString(mixed)
構文
斜め分数 (diagonal fraction) で表記します。
引数
mixed
trueで帯分数、省略若しくはfalseで真分数・仮分数
戻り値
HTML (Hyper Text Markup Language) タグで表した斜め分数
Fraction.prototype.diagString = function(mixed) {
/* 斜め分数 (diagonal fraction) 表記 (HTML出力) */
	mixed = mixed || false;
	var whole = 0;
	var num = Math.abs(this.num);
	var sign = this.num < 0 ? '&minus;' : '';
	if (num < this.denom) mixed = false;	// 分子<分母のときは帯分数modeを強制解除
	var str = '';

	if (mixed) {
		var m = this._convert_to_mixed();
		whole = m.whole;
		num = m.remainder;
		sign = m.sign;
	}
	if (this.denom === 1) {
		str += this.num.toString();
	} else {
		if (whole > 0) {
			str += sign;
			str += whole;	// 帯分数の整数部
		}
		if (num > 0) {
			str += '<sup>';
			if (whole === 0) str += sign;
			str += num;
			str += '</sup>&frasl;<sub>';
			str += this.denom;
			str += '</sub>';
		}
	}
	return str;
};

valueOf

機能
分数の値を数値で返します。
構文
valueOf()
引数
なし
戻り値
分数の値
Fraction.prototype.valueOf = function() {
/* 小数表記 */
	return this.num / this.denom;
};

toJapanNumeral

機能
toJapanNumeral(percentage)
構文
分数を漢数字の小数(こかず) (Japanese numerals) 表記にします。
引数
percentage
trueで歩合 (割分厘毛)、省略若しくはfalseで12桁の小数 (分〜漠)
戻り値
分・厘… で表した値 or 歩合の文字列
Fraction.prototype.toJapanNumeral = function(percentage) {
/* 漢数字の小数 (Japanese numerals) 表記 */
	var a = this.num / this.denom;
	var sign = a < 0 ? '-' : '';
	var chr = ['分', '厘', '毛', '糸', '忽', '微', '繊', '沙', '塵', '埃', '渺', '漠'];

	a = Math.abs(a);
	if (percentage) {
	// percentage=true: 歩合 (割・分・厘・毛)
		a = +a.toFixed(4);
		a *= 10;
	} else {
		a = +a.toFixed(12);
	}
	var ka = Math.floor(a);	// 箇 or 割
	var d = [];
	for (var i = 0; i < chr.length; i++) {
		a =  (a * 10) % 10;
		d.push(Math.floor(a));
		if (percentage && i === 2) break;
	}
	var str ='';
	if (ka > 0) str += ka + (percentage ? '割' : '箇');
	for (var i = 0; i < d.length; i++) {
		if (d[i] > 0) str += d[i] + chr[i];
	}
	return str ? sign + str : '0' + (percentage ? '割' : '');
};

toPercentage

機能
分数を百分率 (パーセント: % / percentage) 表記にします。
構文
toPercentage(digits)
引数
digits
小数点以下の桁数で、省略時は2桁
戻り値
パーセント単位の文字列
Fraction.prototype.toPercentage = function(digits) {
/* 百分率 (パーセント: %) 表記 */
	var p = (this.num / this.denom) * 100;
	if (digits !== undefined) {
		return p.toFixed(digits) + '%';
	}
	return p + '%';
};

toContinuedFraction

機能
連分数展開 (continued fraction expansion) をします。
構文
toContinuedFraction()
引数
なし
戻り値
連分数展開の部分商 (partial quotient) 配列
制限事項
100項で計算を打ち切ります。

詳細は連分数展開 "ContFract!" をご参照下さい。

Fraction.prototype.toContinuedFraction = function() {
/* 連分数 (continued fraction) 展開 */
	var euclidean = function(a, b) {
	/* Euclidean Algorithmによる計算 */
		var q = []
		var quotient, r;
		var i = 0;
		var MAX_TERM = 100;	// 無限ループ防止用の最大項数

		if (b < 0) {
		// 分母が負→分子と分母の符号を調整し分母を常に正
			a = -a;
			b = -b;
		}
		while (b !== 0 && i < MAX_TERM) {
			quotient = Math.floor(a / b);
			q.push(quotient);
			r = ((a % b) + b) % b;	// 余り0≦r<|b|
			a = b;
			b = r;
			i++;
		}
		return q;
	};
	return euclidean(this.num, this.denom);
};

toContinuedString

機能
連分数展開を数列表記 (sequence notation) にします。
構文
toContinuedString()
引数
なし
戻り値
連分数展開の数列表記
Fraction.prototype.toContinuedString = function() {
/* 連分数の数列表記 */
	var q = this.toContinuedFraction();
	var str ='[';
	if (q.length > 0) {
		str += q[0];
		if (q.length > 1) {
			str += ';'
			str += q.slice(1).join(',');
		}
	}
	str += ']';
	return str;
};

toRepeatingString

機能
循環小数 (repeating decimal, recurring decimal) 表記にします。
構文
toRepeatingString()
引数
なし
戻り値
循環節 (repeating part, repetend) を括弧で括った循環小数文字列
制限事項
10万桁に達した時点で計算を打ち切ります。
Fraction.prototype.toRepeatingString = function() {
/* 循環小数に変換 */
	var num = Math.abs(this.num);
	var denom = Math.abs(this.denom);
	var str = this.num < 0 ? '-' : '';
	var MAX_DIGITS = 100000;	// 最大桁数制限

	// 整数部
	var whole = Math.floor(num / denom);
	var rem = num % denom;
	str += whole;

	// 小数部の除算
	var quotient = [];	// 商の小数部1桁 
	var rem_map = {};	// 余りの出現位置を記録するobject
	if (rem !== 0) str += '.';
	while (rem !== 0) {
		if (rem_map[rem] !== undefined) {
		// 既に出てきた余りを検出
			var repeat_start = rem_map[rem];
			var non_repeat = quotient.slice(0, repeat_start).join('');
			var repeat = quotient.slice(repeat_start).join('');
			// 循環部を()で囲んで結合
			str += non_repeat;
			str += '(';
			str += repeat;
			str += ')';
			break;
		}
		if (quotient.length >= MAX_DIGITS) {
		// 桁数制限に達したら計算打ち切り
			str += quotient.join('');
			str += '…(ry';
			break;
		}

		// 現在の余りの桁を記録
		rem_map[rem] = quotient.length;

		// 10倍して割る (筆算の手法)
		rem *= 10;
		quotient.push(Math.floor(rem /denom).toString());
		rem %= denom;

		// 循環せず割り切れた場合 (有限小数)
		if (rem === 0) str += quotient.join('');
	}
	return str;
};

toRatioString

機能
分数を比 (ratio) で表します。
構文
toRatioString(mode, digits)
引数
mode
'1:N'で前項 (antecedent) が1、'N:1'で後項 (consequent) が1、省略時は簡約化 (simplification, reduce) した比
digits
小数点以下の桁数で、省略時は2桁
戻り値
比を表す文字列
Fraction.prototype.toRatioString = function(mode, digits) {
/* 比 (ratio) 表記 */
	var mode = mode || '';
	var d = digits !== undefined ? digits : 2;	// 小数点以下の桁数 
	var str = '';
	if (mode === '1:N') {
	// 前項 (antecedent) を1
		var val = this.denom / this.num;
		str = '1:';
		str += val.toFixed(d);
	} else if (mode === 'N:1') {
	// 後項 (consequent) を1
		var val = this.num / this.denom;
		str = val.toFixed(d);
		str += ':1';
	} else {
	// 通常
		str = this.num.toString();
		str += ':';
		str += this.denom;
	}
	return str;
};

汎用関数

以下の関数は汎用関数 (generic function) で、内部変数を使用していない静的メソッドです。このため、インスタンスを生成しなくても使用できます。

get_decimal_places

機能
実数 n の小数点以下の桁数を求めます。
構文
Fraction.get_decimal_places(n)
引数
n
小数点以下の桁数を求める実数
戻り値
小数点以下の桁数
正規表現
Regexper
Fraction.get_decimal_places = function(n) {
/* 小数点以下の桁数を求める関数 */
	var regex = /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/
	var match = (''+ n).match(regex);
	if (match) {
		return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));
	} else {
		return 0;
	}
};

ipow

機能
実数 x の自然数 n 乗を求めます。
構文
Fraction.ipow(x, n)
引数
x
累乗の基準となる数である底 (base)
n
底 x を何乗するかを表す数である指数 (exponent)
戻り値
数値 x を n 乗した値

詳細は数値計算集 "Algorithm!" をご参照下さい。

Fraction.ipow = function(x, n) {
/* xの累乗(x^n) */
	var v = 1;
	while (n > 0) {
		if ((n & 1) == 1) {
			v *= x;	// nのLSBが1ならば、x^(2^i)をかける
		}
		x *= x;
		n >>= 1;	// 1bit右シフト
	}
	return v;
};

from_continued_sequence

機能
連分数の数列表記を部分商配列に変換
構文
Fraction.from_continued_sequence(str)
引数
str
連分数の数列表記 [整数; 自然数, 自然数, …]
戻り値
連分数の部分商配列
正規表現
Regexper

詳細は連分数展開 "ContFract!" をご参照下さい。

Fraction.from_continued_sequence = function(str) {
/* 連分数の数列表記⇒部分商配列変換 */
	var regex = /^\[[+-]?\d+;\s*\d+(?:,\s*\d+)*\]$/	// 正規化表現
	var match = str.match(regex);
	if (!match) {
		alert('連分数の書式が不正です。\n[整数;自然数,自然数,...]');
		throw new Error("連分数の書式が不正");
	}
	var cf = [ str.substring(1, str.indexOf(';')) ];
	// strの ; の右側の文字列を分割し、cfと結合後に数値型に変換
	return cf.concat(str.slice(str.indexOf(';') + 1, str.length-1).split(',')).map(function(item) {
		return Number(item);
	});
};

continued_convergent

機能
連分数の部分商配列 cont_fract から近似分数を算出
構文
Fraction.continued_convergent(cont_fract)
引数
cont_fract
連分数の部分商配列
戻り値
近似分数の配列

詳細は連分数展開 "ContFract!" をご参照下さい。

Fraction.continued_convergent = function(cont_fract) {
/* 連分数の部分商配列から近似分数を算出 */
	var multi_matrix = function(a, b) {
	/* 2×2行列の積 */
		return [[a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1]],
				[a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]]];
	};
	var conv = [[1, 0], [0, 1]];	// 連分数展開における近似分数(convergent)
	var convergent = [];
	for (var i = 0; i < cont_fract.length; i++) {
		conv = multi_matrix(conv, [[cont_fract[i], 1], [1, 0]]);
		convergent.push({ num: conv[0][0], denom: conv[1][0] });
	}
	return convergent;
};

from_repeating_decimal

機能
循環小数を分数に変換
構文
Fraction.from_repeating_decimal(str)
引数
str
整数部.非循環部(循環節) 形式の循環小数
戻り値
連想配列型の分数
正規表現
Regexper
Fraction.from_repeating_decimal = function(str) {
/* 循環小数⇒分数変換 */
	// 正規表現で「整数部」「非循環小数部」「循環節」に分解
	var regex = /^([+-]?\d+)(?:\.(\d*)\((\d+)\))?$/;
	var match = str.match(regex);
	if (!match) {
		alert("循環小数の書式が不正です。\n'整数部.非循環部(循環節)'");
		throw new Error("循環小数の書式が不正");
	}
	var str_whole = match[1] || '0';
	var str_non_repeat = match[2] || '';
	var str_repeat = match[3];

	// 循環節がない場合は通常の数値として処理
	if (!str_repeat) {
		return {num: parseFloat(str), denom: 1};
	}
	var sign = str_whole.indexOf('-') === 0 ? -1 : 1;
	var whole = Math.abs(parseInt(str_whole, 10));

	var m_non_repeat = str_non_repeat.length;	// 非循環部の桁数
	var m_repeat = str_repeat.length;		// 循環節の桁数

	var num1 = str_non_repeat === "" ? 0 : parseInt(str_non_repeat, 10);
	var num2 = parseInt(str_non_repeat + str_repeat, 10);

	// 循環小数から分数への変換公式: (全体 - 非循環部) / (9がm_repeat個、0がm_non_repeat個)
	var num = num2 - num1;
	var denom = Fraction.ipow(10, m_non_repeat) * (Fraction.ipow(10, m_repeat) - 1);

	num += whole * denom;	// 整数部分を足し合わせる
	num *= sign;		// 最後に符号を適用
	return {num: num, denom: denom};
};

補助関数

内部で下記の補助関数 (helper function) を使用しています。

_reduce

機能
約分 (reduce)
引数
なし
戻り値
約分後の分数
Fraction.prototype._reduce = function() {
/* 約分 (reduce) */
	// Euclidean Algorithmによる最大公約数gの計算
	var a = Math.abs(this.num);
	var b = Math.abs(this.denom);
	var r;
	while (b !== 0) {
		r = a % b;
		a = b;
		b = r;
	}
	var g = Math.abs(a);

	// 約分
	this.num /= g;
	this.denom /= g;
};

_fix_sign

機能
分母の負号を除去し、分子に付加
引数
なし
戻り値
負号を分子に付加後の分数
Fraction.prototype._fix_sign = function() {
/* 分母の負号を除去、分子に付加 */
	if (this.denom < 0) {
		this.num = -this.num;
		this.denom = -this.denom;
	}
};

_convert_to_mixed

機能
帯分数の整数部と分子を計算
引数
なし
戻り値
帯分数
Fraction.prototype._convert_to_mixed = function() {
// 帯分数の整数部と分子を計算
	var whole = 0;				// 整数部
	var rem = 0;				// 帯分数の分子
	var sign = this.num < 0 ? '-' : '';	// 符号
	var abs_num = Math.abs(this.num);
	if (abs_num >= this.denom) {
		whole = Math.floor(abs_num / this.denom);
		rem = abs_num % this.denom;
	}
	return { whole: whole, remainder: rem, sign: sign };
};

謝辞?

今回もアルゴリズムなどの検証でGoogle検索のAIチャット (Gemini) には大変お世話になりました…


正当なCSSです!