From 2cdfefeb14ae967bd2d7029733b5e7a8fed05d9a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 13 Mar 2026 20:00:25 +0900 Subject: feat(blog): update post /posts/2025-10-31/representing-single-value-with-half-open-float-interval/ --- .../index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval') diff --git a/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval/index.html b/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval/index.html index 535e9e49..70eeda62 100644 --- a/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval/index.html +++ b/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval/index.html @@ -168,7 +168,7 @@

PHP で nextUp を実装する

- プログラミング言語によっては標準ライブラリに nextUp 相当の操作が定められているものもある。PHP には無かったので自作した。 + プログラミング言語によっては標準ライブラリに nextUp 相当の操作が定められているものもある。今回は PHP で使いたかったのだが、無かったので自作した。

- binary64 を 64 bit の整数に変換できるなら、他の言語でもほとんど同じ方法で実装できるはずだ。 + binary64 とそのビット表現を相互に変換できるなら、他の言語でもほとんど同じ方法で実装できるはずだ。

public static function nextUp(float $x): float @@ -196,7 +196,7 @@
if ($x === 0.0) {
return self::minValue();
} -
// binary64 を 64 bit 整数に変換する。 +
// binary64 のビット表現を 64 bit 整数として得る。
$u = self::floatToInt($x);
// 正なら整数に +1 して binary64 に戻す。
// 負なら整数に -1 して binary64 に戻す。 -- cgit v1.3-1-g0d28