aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/nuldoc/content
diff options
context:
space:
mode:
Diffstat (limited to 'services/nuldoc/content')
-rw-r--r--services/nuldoc/content/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/content/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md b/services/nuldoc/content/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
index 3566e549..f7a08d2a 100644
--- a/services/nuldoc/content/posts/2025-10-31/representing-single-value-with-half-open-float-interval.md
+++ b/services/nuldoc/content/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 に戻す。