« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 79 for decimal (0.002 sec.)
ビット演算子 | PHP 8.3 14285
ビット演算子 ビット演算子は、整数値の特定のビットの評価や操作を行います。 ビット演算子 例 名前 結果 $a & $b ビット積 $a および $b の両方にセットされているビットがセットされます $a | $b ビット和 $a または $b のどちらかにセットされているビット ... mat = '%0' . ( PHP_INT_SIZE * 8 ) . "b\n" ; printf ( "Expression: %d = %d %s %d\n" , $res , $val , $op , $places ); echo " Decimal:\n" ; printf ( " val=%d\n" , $val ); printf ( " res=%d\n" , $res ); echo " Binary:\n" ; printf ( ' val=' . $format , $val ... 上の例の 32 ビットマシンでの出力は、このようになります。 --- BIT SHIFT RIGHT ON POSITIVE INTEGERS --- Expression: 2 = 4 >> 1 Decimal: val=4 res=2 Binary: val=00000000000000000000000000000100 res=00000000000000000000000000000010 NOTE: copy of sign bit shif ... ted into left side Expression: 1 = 4 >> 2 Decimal: val=4 res=1 Binary: val=00000000000000000000000000000100 res=00000000000000000000000000000001 Expression: 0 = 4 >> 3 Deci ...
https://man.mtool.work/php/8.3/language.operators.bitwise.html
bcround — 任意精度数値を丸める | PHP 8.3 12321
bcround (PHP 8 >= 8.4.0) bcround — 任意精度数値を丸める 説明 function bcround ( string $num , int $precision = 0 , RoundingMode $mode = RoundingMode::HalfAwayFromZero ): string num を、指定した precision (小数点以下の桁数)に丸めた値を返しま ... "9" 例4 bcround() で precision を指定し、 異なる mode を指定した例 <?php echo 'Using RoundingMode::HalfAwayFromZero with 1 decimal digit precision' . PHP_EOL ; var_dump ( bcround ( 1.55 , 1 , RoundingMode :: HalfAwayFromZero )); var_dump ( bcround (- 1. ... 55 , 1 , RoundingMode :: HalfAwayFromZero )); echo PHP_EOL ; echo 'Using RoundingMode::HalfTowardsZero with 1 decimal digit precision' . PHP_EOL ; var_dump ( bcround ( 1.55 , 1 , RoundingMode :: HalfTowardsZero )); var_dump ( bcround (- 1.5 ... 5 , 1 , RoundingMode :: HalfTowardsZero )); echo PHP_EOL ; echo 'Using RoundingMode::HalfEven with 1 decimal digit precision' . PHP_EOL ; var_dump ( bcround ( 1.55 , 1 , RoundingMode :: HalfEven )); var_dump ( bcround (- 1.55 , 1 , ...
https://man.mtool.work/php/8.3/function.bcround.html
BcMath\Number::round — 任意精度数値を丸める | PHP 8.3 11153
BcMath\Number::round (PHP 8 >= 8.4.0) BcMath\Number::round — 任意精度数値を丸める 説明 public function BcMath\Number::round ( int $precision = 0 , RoundingMode $mode = RoundingMode::HalfAwayFromZero ): BcMath\Number $this を、指定した preci ... new BcMath\Number ( '1.55' ); $negative = new BcMath\Number ( '-1.55' ); echo 'Using RoundingMode::HalfAwayFromZero with 1 decimal digit precision' . PHP_EOL ; var_dump ( $positive -> round ( 1 , RoundingMode :: HalfAwayFromZero ), $negative -> round ( ... 1 , RoundingMode :: HalfAwayFromZero ), ); echo PHP_EOL ; echo 'Using RoundingMode::HalfTowardsZero with 1 decimal digit precision' . PHP_EOL ; var_dump ( $positive -> round ( 1 , RoundingMode :: HalfTowardsZero ), $negative -> round ( 1 ... , RoundingMode :: HalfTowardsZero ), ); echo PHP_EOL ; echo 'Using RoundingMode::HalfEven with 1 decimal digit precision' . PHP_EOL ; var_dump ( $positive -> round ( 1 , RoundingMode :: HalfEven ), $negative -> round ( 1 , Roun ...
https://man.mtool.work/php/8.3/bcmath-number.round.html
NumberFormatter クラス | PHP 8.3 9986
NumberFormatter クラス (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0) はじめに プログラムで数値を保存したり操作したりする際には、 ロケールに依存しないバイナリ表現を使用します。 数値を表示するときに、ロケールにあわせた文字列形式に変換しま ... 場合は、 ルールベースの数値フォーマッタを使用します。 クラス概要 class NumberFormatter { /* 定数 */ public const int PATTERN_DECIMAL ; public const int DECIMAL ; public const int DECIMAL_COMPACT_SHORT ; public const int DECIMAL_COMPACT_LONG ; public const ... ; public const int PAD_AFTER_SUFFIX ; public const int PARSE_INT_ONLY ; public const int GROUPING_USED ; public const int DECIMAL_ALWAYS_SHOWN ; public const int MAX_INTEGER_DIGITS ; public const int MIN_INTEGER_DIGITS ; public const int INTEGER_DIGITS ... ; public const int CURRENCY_CODE ; public const int DEFAULT_RULESET ; public const int PUBLIC_RULESETS ; public const int DECIMAL_SEPARATOR_SYMBOL ; public const int GROUPING_SEPARATOR_SYMBOL ; public const int PATTERN_SEPARATOR_SYMBOL ; public const i ...
https://man.mtool.work/php/8.3/class.numberformatter.html
round — 浮動小数点数を丸める | PHP 8.3 9038
round (PHP 4, PHP 5, PHP 7, PHP 8) round — 浮動小数点数を丸める 説明 function round ( int | float $num , int $precision = 0 , int | RoundingMode $mode = RoundingMode::HalfAwayFromZero ): float num を、指定した precision (小数点以下の桁数)に ... modes with 8.5 float(9) float(8) float(8) float(9) 例4 桁数を指定した mode の例 <?php echo 'Using PHP_ROUND_HALF_UP with 1 decimal digit precision' . PHP_EOL ; var_dump ( round ( 1.55 , 1 , PHP_ROUND_HALF_UP )); var_dump ( round (- 1.55 , 1 , PHP_ROUND_ ... HALF_UP )); echo PHP_EOL ; echo 'Using PHP_ROUND_HALF_DOWN with 1 decimal digit precision' . PHP_EOL ; var_dump ( round ( 1.55 , 1 , PHP_ROUND_HALF_DOWN )); var_dump ( round (- 1.55 , 1 , PHP_ROUN ... D_HALF_DOWN )); echo PHP_EOL ; echo 'Using PHP_ROUND_HALF_EVEN with 1 decimal digit precision' . PHP_EOL ; var_dump ( round ( 1.55 , 1 , PHP_ROUND_HALF_EVEN )); var_dump ( round (- 1.55 , 1 , PHP_ROUN ...
https://man.mtool.work/php/8.3/function.round.html
The MongoDB\BSON\Decimal128 class | PHP 8.3 8818
The MongoDB\BSON\Decimal128 class (mongodb >=1.2.0) はじめに BSON type for the » Decimal128 floating-point format , which supports numbers with up to 34 decimal digits (i.e. significant digits) and an exponent range of -6143 to +6144. Unlik ... e the double BSON type (i.e. float in PHP), which only stores an approximation of the decimal values, the decimal data type stores the exact value. For example, MongoDB\BSON\Decimal128('9.99') has a precise value of ... 9.99 where as a double 9.99 would have an approximate value of 9.9900000000000002131628…. 注意 : MongoDB\BSON\Decimal128 is only compatible with MongoDB 3.4+. Attempting to use the BSON type with an earlier version of MongoDB will result in ... an error. クラス概要 final class MongoDB\BSON\Decimal128 implements MongoDB\BSON\Decimal128Interface , MongoDB\BSON\Type , JsonSerializable , Stringable { /* メソッド */ final ...
https://man.mtool.work/php/8.3/class.mongodb-bson-decimal128.html
MongoDB\BSON\Decimal128::__construct — Construct a new Decimal128 | PHP 8.3 8090
MongoDB\BSON\Decimal128::__construct (mongodb >=1.2.0) MongoDB\BSON\Decimal128::__construct — Construct a new Decimal128 説明 final public function MongoDB\BSON\Decimal128::__construct ( string $value ) 注意 : MongoDB\BSON\Decimal128 is onl ... Attempting to use the BSON type with an earlier version of MongoDB will result in an error. パラメータ value ( string ) A decimal string. エラー / 例外 Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. Throws MongoDB\ ... Driver\Exception\InvalidArgumentException if value is not a valid decimal string. 例 例1 MongoDB\BSON\Decimal128::__construct() example <?php var_dump (new MongoDB\BSON\Decimal128 ( 1234.5678 )); ... var_dump (new MongoDB\BSON\Decimal128 ( NAN )); var_dump (new MongoDB\BSON\Decimal128 ( INF )); ?> 上の例の出力は、 たとえば以下のようになります。 object(Mon ...
https://man.mtool.work/php/8.3/mongodb-bson-decimal128.construct.html
IntlChar::charDigitValue — 10進数の桁の文字を桁の値として取得する | PHP 8.3 8021
IntlChar::charDigitValue (PHP 7, PHP 8) IntlChar::charDigitValue — 10進数の桁の文字を桁の値として取得する 説明 public static function IntlChar::charDigitValue ( int | string $codepoint ): ? int 10進数の桁の文字を、桁の値として取得します。 対 ... 象となる文字は、一般カテゴリ "Nd" (decimal digit numbers) と a Numeric_Type of Decimal に属するものです。 パラメータ codepoint コードポイントを表す int 型の値 (例: U ... ) int(3) 参考 IntlChar::getNumericValue() - Unicode のコードポイントの数値の値を取得する 他のマニュアルの関連ページ Python decimal Python pending-removal-in-3.18 Python html.entities ...
https://man.mtool.work/php/8.3/intlchar.chardigitvalue.html
number_format — 数字を千の位毎にグループ化してフォーマットする | PHP 8.3 7733
number_format (PHP 4, PHP 5, PHP 7, PHP 8) number_format — 数字を千の位毎にグループ化してフォーマットする 説明 function number_format ( float $num , int $decimals = 0 , ? string $decimal_separator = "." , ? string $thousands_separator = "," ... の桁も追加してフォーマットします。小数の桁を追加する場合、四捨五入のルールを使います。 パラメータ num フォーマットする数値。 decimals 小数点以下の桁数。 0 を指定すると、 戻り値の decimal_separator は省略されます。 PHP 8.3.0 以降では、この値に負の値を指定す ... ると、 num は小数点前の有効桁数 decimals 桁に丸められるようになりました。 これより前のバージョンでは、負の値を指定しても無視され、 0 を指定した場合と同じように処理 ... されていました。 decimal_separator 小数点を表す区切り文字。 thousands_separator 千の位毎の区切り文字。 戻り値 num をフォーマットした結果を返します。 ...
https://man.mtool.work/php/8.3/function.number-format.html
localeconv — 数値に関するフォーマット情報を得る | PHP 8.3 7513
localeconv (PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8) localeconv — 数値に関するフォーマット情報を得る 説明 function localeconv (): array ローカルな数値および通貨フォーマット情報を有する連想配列を返します。 パラメータ この関数にはパラメータはあり ... locale() で設定された現在のロケールに基づきデータを返します。 返される連想配列は、次のフィールドを有します。 配列要素 説明 decimal_point 小数点文字 thousands_sep 千毎の区切り文字 grouping 数値集合を有する配列 int_curr_symbol 国際通貨記号 (すなわち、USD) ... currency_symbol ローカルな通貨記号 (すなわち、$) mon_decimal_point 通貨用の小数点文字 mon_thousands_sep 通貨用の千毎の区切り文字 mon_grouping 通貨集合を有する配列 positive_sign 正の値 ... l_NL.UTF-8@euro' )) { $locale_info = localeconv (); print_r ( $locale_info ); } ?> 上の例の出力は以下となります。 Array ( [decimal_point] => . [thousands_sep] => [int_curr_symbol] => EUR [currency_symbol] => € [mon_decimal_point] => , [mon_thousands_sep ...
https://man.mtool.work/php/8.3/function.localeconv.html
PREV 1 2 3 4 5 6 7 8 NEXT