aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-03-13 20:00:25 +0900
committernsfisis <nsfisis@gmail.com>2026-03-13 20:00:25 +0900
commit2cdfefeb14ae967bd2d7029733b5e7a8fed05d9a (patch)
tree388dfc37e303e0e8822b841f9ba7d70080e22a2d /services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
parent2913b09233ac0c83143fb004896a7b1fec5fca99 (diff)
downloadnsfisis.dev-2cdfefeb14ae967bd2d7029733b5e7a8fed05d9a.tar.gz
nsfisis.dev-2cdfefeb14ae967bd2d7029733b5e7a8fed05d9a.tar.zst
nsfisis.dev-2cdfefeb14ae967bd2d7029733b5e7a8fed05d9a.zip
feat(blog): update post /posts/2025-10-31/representing-single-value-with-half-open-float-interval/HEADmain
Diffstat (limited to 'services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md')
-rw-r--r--services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md b/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
index 3566e549..f7a08d2a 100644
--- a/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
+++ b/services/nuldoc/public/blog/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
@@ -78,12 +78,12 @@ IEEE 754 にはこのような用途に用いることができる `nextUp` と
# PHP で nextUp を実装する {#nextup-in-php}
プログラミング言語によっては標準ライブラリに `nextUp` 相当の操作が定められているものもある。
-PHP には無かったので自作した。
+今回は PHP で使いたかったのだが、無かったので自作した。
* GitHub: https://github.com/nsfisis/php-next-after
* Packagist: https://packagist.org/packages/nsfisis/next-after
-`binary64` を 64 bit の整数に変換できるなら、他の言語でもほとんど同じ方法で実装できるはずだ。
+`binary64` とそのビット表現を相互に変換できるなら、他の言語でもほとんど同じ方法で実装できるはずだ。
```php
public static function nextUp(float $x): float
@@ -100,7 +100,7 @@ PHP には無かったので自作した。
if ($x === 0.0) {
return self::minValue();
}
- // binary64 を 64 bit 整数に変換する。
+ // binary64 のビット表現を 64 bit 整数として得る。
$u = self::floatToInt($x);
// 正なら整数に +1 して binary64 に戻す。
// 負なら整数に -1 して binary64 に戻す。