mirror of
https://github.com/php/doc-ja.git
synced 2026-03-27 00:22:08 +01:00
Cf. <https://github.com/php/doc-en/pull/289>. git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@352198 c90b9560-bf6c-de11-be94-00142212c4b1
110 lines
3.1 KiB
XML
110 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: mumumu Status: ready -->
|
|
|
|
<refentry xml:id="function.fdiv" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>fdiv</refname>
|
|
<refpurpose>IEEE 754 に従い、数値の除算を行う</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>float</type><methodname>fdiv</methodname>
|
|
<methodparam><type>float</type><parameter>num1</parameter></methodparam>
|
|
<methodparam><type>float</type><parameter>num2</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<parameter>num1</parameter> を <parameter>num2</parameter>
|
|
で割った結果を浮動小数点数の結果として返します。
|
|
<parameter>num2</parameter> が 0 の場合、
|
|
<literal>INF</literal>,
|
|
<literal>-INF</literal>,
|
|
<literal>NAN</literal> のうちのいずれかを返します。
|
|
</para>
|
|
<para>
|
|
<literal>NAN</literal> は
|
|
<code>==</code> や <code>===</code> のいずれを使っても、いかなる値とも比較できないことに注意して下さい。
|
|
<literal>NAN</literal> は、<literal>NAN</literal> のみと比較できます。
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>num1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
被除数(分子)
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>num2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
除数
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<parameter>num1</parameter>/<parameter>num2</parameter> の結果を浮動小数点数として返します。
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>fdiv</function> を使う</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(fdiv(5.7, 1.3)); // float(4.384615384615385)
|
|
var_dump(fdiv(4, 2)); // float(2)
|
|
var_dump(fdiv(1.0, 0.0)); // float(INF)
|
|
var_dump(fdiv(-1.0, 0.0)); // float(-INF)
|
|
var_dump(fdiv(0.0, 0.0)); // float(NAN)
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><link linkend="language.operators.arithmetic"><literal>/</literal></link> - 浮動小数点数の除算</member>
|
|
<member><function>intdiv</function> - 整数値の除算</member>
|
|
<member><function>fmod</function> - 剰余</member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|