Skip to main content

Module extra_static

Module extra_static 

Source

Functions§

apply_define_property 🔒
make_property_descriptor 🔒
math_acos 🔒
math_acosh 🔒
math_asin 🔒
math_asinh 🔒
math_atan 🔒
math_atan2 🔒
math_atanh 🔒
math_cbrt 🔒
math_clamp 🔒
Math.clamp(x, min, max)(ECMAScript Proposal Stage 3/4)。 数値 x を [min, max] の範囲内に制限する。
math_clz32 🔒
Math.clz32(x)(ES2015)が丸ごと未対応だった。x を仕様どおり ToUint32 (下位32bitへ切り詰め)してから先頭の連続 0 ビット数を返す(x=0 は 32)。
math_cosh 🔒
math_expm1 🔒
math_f16round 🔒
Math.f16round(x)(ES2025)。半精度 16bit 浮動小数点数(IEEE 754 half-precision float) として表現可能な最も近い値へ丸める(Float16Array と同等の丸め)。
math_fround 🔒
Math.fround(x)(ES2015)が丸ごと未対応だった。32bit 単精度浮動小数点として 表現可能な最も近い値へ丸める(WebGL/Canvas 等で GPU 側の float32 精度に 合わせる定番イディオム)。f64 -> f32 -> f64 の往復キャストで単精度の 丸め誤差を再現する。
math_hypot 🔒
math_imul 🔒
Math.imul(a, b)(ES2015)が丸ごと未対応だった。両引数を ToInt32 してから 32bit 整数の乗算をラップアラウンド(オーバーフロー時は下位32bitのみ保持)で 行う。通常の浮動小数点乗算は 2^53 を超えると精度落ちするため、64bit整数の 大きな値を正確に掛け合わせたい場面で使われる。
math_log2 🔒
math_log1p 🔒
math_log10 🔒
math_sinh 🔒
math_sum_precise 🔒
Math.sumPrecise(iterable)(ES2025 Standard)。 反復可能オブジェクト(Array, Set, Map Iterator 等)内のすべての数値を正確に合計する。 特殊値 (NaN, +Inf/-Inf の混在) や IEEE 754 の丸め誤差を Kahan-Babuška-Neumaier 補正加算で精密に処理。
math_tan 🔒
math_tanh 🔒
number_is_finite_static 🔒
number_is_integer 🔒
number_is_nan_static 🔒
number_is_safe_integer 🔒
object_create 🔒
object_define_properties 🔒
object_define_property 🔒
object_freeze 🔒
Object.freeze(obj)。以前は「凍結は no-op(同一オブジェクトを返すだけ)」という 明示的な簡略化だったが、set_property()/delete 側に frozen フラグの実チェックを 追加したことで、実際にプロパティの追加・変更・削除を黙殺するようになった。
object_from_entries 🔒
object_get_own_property_descriptor 🔒
object_get_own_property_descriptors 🔒
object_get_prototype_of 🔒
Object.getPrototypeOf(obj)(ES5)。Reflect.getPrototypeOf と同じロジックだが、 こちらは instanceof/クラス継承の確認によく使われる、はるかに一般的な API。
object_is 🔒
Object.is(a, b)(ES2015、SameValue)。===/SameValueZero と違い、NaN 同士は 等しいと判定し、かつ +0/-0 は区別して等しくないと判定する(両方の性質を持つのは SameValue だけ。SameValueZero は +0/-0 を区別しない)。
object_is_extensible 🔒
object_is_frozen 🔒
Object.isFrozen(obj)。プリミティブは仕様どおり常に true(凍結済み扱い)。
object_is_sealed 🔒
object_prevent_extensions 🔒
Object.preventExtensions(obj)seal よりさらに弱い: 新規プロパティの追加のみ禁止)。
object_seal 🔒
Object.seal(obj)freeze より弱い: 新規プロパティの追加・既存プロパティの削除のみ 禁止し、既存値の変更は許可する)。freeze と同様、以前は丸ごと欠落していた。
object_set_prototype_of 🔒
Object.setPrototypeOf(obj, proto)(ES6)。protonull ならプロトタイプ連鎖を切る。