* Bug 14741 fixed: [m,e]=log2(x) documented. frexp()=>internal 02/21002/4
Samuel GOUGEON [Mon, 10 Jun 2019 02:58:26 +0000 (04:58 +0200)]
  http://bugzilla.scilab.org/14741

  New log2() page (PDF): http://bugzilla.scilab.org/attachment.cgi?id=4969

Change-Id: I0984bcc505bd428a0d5df97d94dac45c39b101b2

39 files changed:
scilab/CHANGES.md
scilab/modules/elementary_functions/help/en_US/exponential/log.xml
scilab/modules/elementary_functions/help/en_US/exponential/log10.xml
scilab/modules/elementary_functions/help/en_US/exponential/log2.xml
scilab/modules/elementary_functions/help/en_US/floating_point/frexp.xml
scilab/modules/elementary_functions/help/en_US/floating_point/nearfloat.xml
scilab/modules/elementary_functions/help/en_US/floating_point/nextpow2.xml
scilab/modules/elementary_functions/help/en_US/floating_point/number_properties.xml
scilab/modules/elementary_functions/help/fr_FR/exponential/log.xml
scilab/modules/elementary_functions/help/fr_FR/exponential/log10.xml
scilab/modules/elementary_functions/help/fr_FR/exponential/log2.xml
scilab/modules/elementary_functions/help/fr_FR/floating_point/frexp.xml
scilab/modules/elementary_functions/help/ja_JP/exponential/log2.xml [deleted file]
scilab/modules/elementary_functions/help/ja_JP/floating_point/frexp.xml
scilab/modules/elementary_functions/help/ja_JP/floating_point/nearfloat.xml
scilab/modules/elementary_functions/help/ja_JP/floating_point/nextpow2.xml
scilab/modules/elementary_functions/help/ja_JP/floating_point/number_properties.xml
scilab/modules/elementary_functions/help/pt_BR/exponential/log2.xml [deleted file]
scilab/modules/elementary_functions/help/pt_BR/floating_point/frexp.xml
scilab/modules/elementary_functions/help/pt_BR/floating_point/nearfloat.xml
scilab/modules/elementary_functions/help/pt_BR/floating_point/nextpow2.xml
scilab/modules/elementary_functions/help/pt_BR/floating_point/number_properties.xml
scilab/modules/elementary_functions/help/ru_RU/exponential/log2.xml
scilab/modules/elementary_functions/help/ru_RU/floating_point/frexp.xml
scilab/modules/elementary_functions/help/ru_RU/floating_point/nearfloat.xml
scilab/modules/elementary_functions/help/ru_RU/floating_point/nextpow2.xml
scilab/modules/elementary_functions/help/ru_RU/floating_point/number_properties.xml
scilab/modules/elementary_functions/macros/log2.sci
scilab/modules/elementary_functions/macros/nextpow2.sci
scilab/modules/elementary_functions/tests/nonreg_tests/bug_10521.dia.ref [deleted file]
scilab/modules/elementary_functions/tests/nonreg_tests/bug_10521.tst
scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.dia.ref [deleted file]
scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.tst [deleted file]
scilab/modules/elementary_functions/tests/unit_tests/log2.tst [new file with mode: 0644]
scilab/modules/helptools/data/configuration/scilab_primitives.txt
scilab/modules/m2sci/help/en_US/m2sci_equivalents/l/log2.xml [deleted file]
scilab/modules/m2sci/macros/sci_files/sci_log2.sci
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp
scilab/modules/sound/macros/lin2mu.sci

index fc88724..09eb112 100644 (file)
@@ -118,6 +118,7 @@ API modification
 
 Obsolete functions or features
 ------------------------------
+* `frexp` becomes an internal. Please use `[m,e]=log2(x)` instead.
 
 
 Removed Functions
@@ -142,6 +143,7 @@ Bug Fixes
 * [#14604](http://bugzilla.scilab.org/show_bug.cgi?id=14604): `emptystr()` is 40x slower with 6.0.0 wrt 5.5.2
 * [#14605](http://bugzilla.scilab.org/show_bug.cgi?id=14605): fixed - `bench_run` was too strict about the specification of tests names.
 * [#14606](http://bugzilla.scilab.org/show_bug.cgi?id=14606): Memory used by variables returned by `[names,mem]=who()` was always zero.
+* [#14741](http://bugzilla.scilab.org/show_bug.cgi?id=14741): The syntax `[m,e]=log2(x)` was not documented. As public function `frexp()` was in duplicate with `[m,e]=log2(x)`.
 * [#14812](http://bugzilla.scilab.org/show_bug.cgi?id=14812): Minor typos in messages.
 * [#14863](http://bugzilla.scilab.org/show_bug.cgi?id=14863): In Xcos, the default ending time was unhandily high (100000), reduced it to 30.
 * [#14982](http://bugzilla.scilab.org/show_bug.cgi?id=14982): `msprintf` segmentation fault was caught due to wrong size
index 2c1f2c0..87fd55d 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log" xml:lang="en">
     <refnamediv>
         <refname>log</refname>
         <refpurpose>natural logarithm</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>y=log(x)</synopsis>
+        <synopsis>y = log(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
@@ -57,6 +60,9 @@ exp(log([1,%i,-1,-%i]))
                 <link linkend="logm">logm</link>
             </member>
             <member>
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
                 <link linkend="log10">log10</link>
             </member>
             <member>
index ce57eb2..3eaeee9 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log10" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log10" xml:lang="en">
     <refnamediv>
         <refname>log10</refname>
         <refpurpose>base 10 logarithm</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>y=log10(x)</synopsis>
+        <synopsis>y = log10(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
@@ -53,6 +56,9 @@
                 <link linkend="log">log</link>
             </member>
             <member>
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
                 <link linkend="logm">logm</link>
             </member>
             <member>
index 044caf5..66fc148 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="en">
     <refnamediv>
         <refname>log2</refname>
-        <refpurpose>base 2 logarithm</refpurpose>
+        <refpurpose>
+            Base-2 logarithm. Base-2 exponents and mantissae of some decimal numbers
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>y=log2(x)</synopsis>
+        <synopsis>
+            y = log2(x)
+            [m,e] = log2(u)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
-                <term>x</term>
+                <term>x, y</term>
+                <listitem>
+                    <para>
+                        arrays of decimal or complex numbers, such that <literal>2.^y = x</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>u, m, e</term>
                 <listitem>
-                    <para>vector or matrix</para>
+                    <para>arrays of decimal numbers such that <literal>u = m .* 2.^e</literal>,
+                        with <literal>sign(m)=sign(u)</literal> and <literal>0.5 ≤ abs(m) &lt; 1</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Description</title>
         <para>
-            <literal>log2(x)</literal> is the "element-wise" base 2 logarithm
-            <literal>y(i,j)=log2(x(i,j))</literal>.
+            <literal>y = log2(x)</literal> is the "element-wise" base 2 logarithm, with
+            <literal>y(i,j) = log2(x(i,j))</literal>.
+            <note>
+                <literal>log2(-%inf) == %inf + log2(-1)</literal>
+            </note>
+        </para>
+        <para>
+            <literal>[m,e]=log2(u)</literal> computes in an element-wise way the base-2 mantissa
+            <varname>m</varname> and exponent <varname>e</varname> of every elements of
+            <varname>u</varname>. Hence, for any index <literal>k</literal> we have
+            <literal>u(k) = m(k) .* 2.^e(k)</literal> with <literal>0.5 ≤ |m(k)| &lt; 1</literal>.
+            <note>
+                <itemizedlist>
+                    <listitem>
+                        <literal>[m,e]=log2([0 %nan -%inf %inf])</literal> returns
+                        <literal>m=[0  NaN -Inf Inf]</literal> and <literal>e=[0 0 0 0]</literal>.
+                    </listitem>
+                    <listitem>
+                        This syntax corresponds to the ANSI C function frexp().
+                    </listitem>
+                </itemizedlist>
+            </note>
         </para>
     </refsection>
     <refsection>
         <title>Examples</title>
+        <para>
+            Base-2 logarithm:
+        </para>
         <programlisting role="example"><![CDATA[
-2.^log2([1,%i,-1,-%i])
+L = log2([-1, 1, 2, %i, -%i])
+clean(2.^L)
+L = log2([0 %nan %inf])
+2 .^ L
+L = log2([0 %nan %inf -%inf]) // -%inf<0 turns the result to complex
+2 .^ L                        // -Inf is not retrieved
  ]]></programlisting>
+    <screen><![CDATA[
+--> L = log2([-1, 1, 2, %i, -%i])
+ L  =
+   4.5323601i   0.   1.   2.2661801i  -2.2661801i
+
+--> clean(2.^L)
+ ans  =
+  -1.   1.   2.   i   -i
+
+--> L = log2([0 %nan %inf])
+ L  =
+  -Inf   Nan   Inf
+
+--> 2 .^ L
+ ans  =
+   0.   Nan   Inf
+
+--> L = log2([0 %nan %inf -%inf]) // -%inf<0 turns the result to complex
+ L  =
+  -Inf   Nan + Nani   Inf   Inf + 4.5323601i
+
+--> 2 .^ L                        // -Inf is not retrieved
+ ans  =
+   0.   Nan + Nani   Inf   Nan + Nani
+]]></screen>
+        <para/>
+        <para>
+            Base-2 mantissa + exponent decomposition:
+        </para>
+        <programlisting role="example"><![CDATA[
+[m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+m .* 2.^e
+ ]]></programlisting>
+    <screen><![CDATA[
+--> [m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+ e  =
+   2.     1.     1.    0.   3.   67.
+ m  =
+  -0.75  -0.75  -0.5   0.   0.5   0.6776264
+
+--> m .* 2.^e
+ ans  =
+  -3.  -1.5  -1.   0.   4.   1.000D+20
+]]></screen>
+    <para/>
+        <programlisting role="example"><![CDATA[
+np = number_properties;
+x = [%eps np("tiniest") np("tiny") np("huge")]
+[m, e] = log2(x)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> x = [%eps np("tiniest") np("tiny") np("huge")]
+ x  =
+    2.220D-16    4.94D-324    2.22D-308    1.79D+308
+
+--> [m, e] = log2(x)
+ e  =
+  - 51.  - 1073.  - 1021.    1024.
+ m  =
+    0.5    0.5    0.5    1.
+]]></screen>
+    <para/>
+        <programlisting role="example"><![CDATA[
+[m, e] = log2([0 %nan -%inf %inf])
+m .* 2.^e
+ ]]></programlisting>
+    <screen><![CDATA[
+-->[m, e] = log2([0 %nan -%inf %inf])
+ e  =
+    0.    0.    0.    0.
+ m  =
+    0.    Nan  - Inf    Inf
+
+-->m .* 2.^e
+ ans  =
+    0.    Nan  - Inf    Inf
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
                 <link linkend="log">log</link>
             </member>
             <member>
-                <link linkend="hat">hat</link>
+                <link linkend="log10">log10</link>
             </member>
             <member>
-                <link linkend="ieee">ieee</link>
+                <link linkend="nextpow2">nextpow2</link>
             </member>
             <member>
-                <link linkend="log10">log10</link>
+                <link linkend="bitstring">bitstring</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="hat">hat</link>
             </member>
         </simplelist>
     </refsection>
index b78cc72..4805a6f 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="en">
     <refnamediv>
         <refname>frexp</refname>
-        <refpurpose>dissect floating-point numbers into base 2 exponent and
-            mantissa
+        <refpurpose>dissect floating-point numbers into base 2 exponent and mantissa
+            <emphasis role="bold">(deprecated)</emphasis>
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>[f,e]=frexp(x)</synopsis>
+        <synopsis>[f, e] = frexp(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
@@ -36,8 +39,7 @@
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>array of real values, usually in the range 0.5 &lt;= abs(f)
-                        &lt; 1.
+                    <para>array of real values, usually in the range 0.5 ≤ abs(f) &lt; 1.
                     </para>
                 </listitem>
             </varlistentry>
@@ -45,9 +47,7 @@
                 <term>e</term>
                 <listitem>
                     <para>
-                        array of integers that satisfy the equation: <literal>x=
-                            f.*2.^e
-                        </literal>
+                        array of integers that satisfy the equation: <literal>x=f.*2.^e</literal>
                     </para>
                 </listitem>
             </varlistentry>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>frexp()</literal> becomes an internal function in Scilab 6.1.x.
+            Please use <literal>[f,e] = log2(x)</literal> instead.
+        </warning>
         <para>This function corresponds to the ANSI C function frexp(). Any zeros
             in <literal>x</literal> produce <literal>f=0</literal> and
             <literal>e=0</literal>.
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    frexp() becomes internal. It is publicly replaced with [f,e]=log2(x).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index a8ea757..581cf55 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="en">
     <refnamediv>
         <refname>nearfloat</refname>
         <refpurpose>get previous or next floating-point number</refpurpose>
@@ -57,7 +60,7 @@ format("v") //reset default format
                 <link linkend="number_properties">number_properties</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index 29090b0..3fae746 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="en">
     <refnamediv>
         <refname>nextpow2</refname>
         <refpurpose>next higher power of 2.</refpurpose>
@@ -62,7 +65,13 @@ nextpow2(0:10)
         <title>See also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="bitstring">bitstring</link>
             </member>
         </simplelist>
     </refsection>
index 6401315..fb11a96 100644 (file)
@@ -161,7 +161,7 @@ eps = number_properties("eps")
                 <link linkend="nearfloat">nearfloat</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index ff66db4..221fcae 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log" xml:lang="fr">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log" xml:lang="fr">
     <refnamediv>
         <refname>log</refname>
         <refpurpose>logarithme naturel</refpurpose>
@@ -49,9 +52,6 @@ exp(log([1,%i,-1,-%i]))
                 <link linkend="exp">exp</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
-            </member>
-            <member>
                 <link linkend="logm">logm</link>
             </member>
             <member>
index 5c20814..d98efd3 100644 (file)
@@ -1,12 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log10" xml:lang="fr">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log10" xml:lang="fr">
     <refnamediv>
         <refname>log10</refname>
         <refpurpose>logarithme en base 10</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>y=log10(x)</synopsis>
+        <synopsis>y = log10(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
@@ -48,9 +51,6 @@
                 <link linkend="exp">exp</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
-            </member>
-            <member>
                 <link linkend="logm">logm</link>
             </member>
             <member>
index 6fc4731..a71735d 100644 (file)
@@ -1,20 +1,50 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="fr">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="fr">
     <refnamediv>
         <refname>log2</refname>
         <refpurpose>logarithme en base 2</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>y=log2(x)</synopsis>
+        <synopsis>
+            y = log2(x)
+            [f, e] = log2(u)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
         <variablelist>
             <varlistentry>
-                <term>x</term>
+                <term>x, y</term>
                 <listitem>
-                    <para>vecteur ou matrice (réelle ou complexe)</para>
+                    <para>
+                        tableaux de nombres décimaux ou complexes, tels que <literal>2.^y = x</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>u, m, e</term>
+                <listitem>
+                    <para>Tableaux de nombres décimaux tels que <literal>u = m .* 2.^e</literal>,
+                        avec <literal>sign(m)=sign(u)</literal> et <literal>0.5 ≤ abs(m) &lt; 1</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <para>
             <literal>log2(x)</literal> calcule le logarithme en base 2 élément
             par élément : <literal>y(i,j)=log2(x(i,j))</literal>.
+            <note>
+                <literal>log2(-%inf) == %inf + log2(-1)</literal>
+            </note>
+        </para>
+        <para>
+            <literal>[m,e]=log2(u)</literal> calcule élément par élément la mantisse
+            <varname>m</varname> et l'exposant <varname>e</varname> de tous les éléments de
+            <varname>u</varname>. Ainsi, pour tout indice <literal>k</literal> nous avons
+            <literal>u(k) = m(k) .* 2.^e(k)</literal> avec <literal>0.5 ≤ |m(k)| &lt; 1</literal>.
+            <note>
+                <itemizedlist>
+                    <listitem>
+                        <literal>[m,e]=log2([0 %nan -%inf %inf])</literal> donne
+                        <literal>m=[0  NaN -Inf Inf]</literal> et <literal>e=[0 0 0 0]</literal>.
+                    </listitem>
+                    <listitem>
+                        Cette syntaxe correspond à la fonction nommée frexp() en langage C ANSI.
+                    </listitem>
+                </itemizedlist>
+            </note>
         </para>
     </refsection>
     <refsection>
         <title>Exemples</title>
+        <para>
+            Logarithme en base 2:
+        </para>
+        <programlisting role="example"><![CDATA[
+L = log2([-1, 1, 2, %i, -%i])
+clean(2.^L)
+L = log2([0 %nan %inf])
+2 .^ L
+L = log2([0 %nan %inf -%inf]) // -%inf<0 rend le résultat complexe
+2 .^ L                        // -Inf n'est pas retrouvé
+ ]]></programlisting>
+    <screen><![CDATA[
+--> L = log2([-1, 1, 2, %i, -%i])
+ L  =
+   4.5323601i   0.   1.   2.2661801i  -2.2661801i
+
+--> clean(2.^L)
+ ans  =
+  -1.   1.   2.   i   -i
+
+--> L = log2([0 %nan %inf])
+ L  =
+  -Inf   Nan   Inf
+
+--> 2 .^ L
+ ans  =
+   0.   Nan   Inf
+
+--> L = log2([0 %nan %inf -%inf]) // -%inf<0 rend le résultat complexe
+ L  =
+  -Inf   Nan + Nani   Inf   Inf + 4.5323601i
+
+--> 2 .^ L                        // -Inf n'est pas retrouvé
+ ans  =
+   0.   Nan + Nani   Inf   Nan + Nani
+]]></screen>
+        <para/>
+        <para>
+            Décomposition en mantisses et exposants en base 2 :
+        </para>
+        <programlisting role="example"><![CDATA[
+[m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+m .* 2.^e
+ ]]></programlisting>
+    <screen><![CDATA[
+--> [m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+ e  =
+   2.     1.     1.    0.   3.   67.
+ m  =
+  -0.75  -0.75  -0.5   0.   0.5   0.6776264
+
+--> m .* 2.^e
+ ans  =
+  -3.  -1.5  -1.   0.   4.   1.000D+20
+]]></screen>
+    <para/>
+        <programlisting role="example"><![CDATA[
+np = number_properties;
+x = [%eps np("tiniest") np("tiny") np("huge")]
+[m, e] = log2(x)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> x = [%eps np("tiniest") np("tiny") np("huge")]
+ x  =
+    2.220D-16    4.94D-324    2.22D-308    1.79D+308
+
+--> [m, e] = log2(x)
+ e  =
+  - 51.  - 1073.  - 1021.    1024.
+ m  =
+    0.5    0.5    0.5    1.
+]]></screen>
+    <para/>
         <programlisting role="example"><![CDATA[
-2.^(log2([1,%i,-1,-%i]))
+[m, e] = log2([0 %nan -%inf %inf])
+m .* 2.^e
  ]]></programlisting>
+    <screen><![CDATA[
+-->[m, e] = log2([0 %nan -%inf %inf])
+ e  =
+    0.    0.    0.    0.
+ m  =
+    0.    Nan  - Inf    Inf
+
+-->m .* 2.^e
+ ans  =
+    0.    Nan  - Inf    Inf
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Voir aussi</title>
                 <link linkend="log10">log10</link>
             </member>
             <member>
-                <link linkend="hat">hat</link>
+                <link linkend="nextpow2">nextpow2</link>
             </member>
             <member>
-                <link linkend="exp">exp</link>
+                <link linkend="bitstring">bitstring</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="hat">hat</link>
             </member>
             <member>
                 <link linkend="logm">logm</link>
             </member>
-            <member>
-                <link linkend="ieee">ieee</link>
-            </member>
         </simplelist>
     </refsection>
 </refentry>
index 78a4dcc..5f5becd 100644 (file)
@@ -1,14 +1,31 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="fr">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="fr">
     <refnamediv>
         <refname>frexp</refname>
-        <refpurpose>calcule la représentation en base 2 (mantisse et exposant)
-            d'un nombre flottant.
+        <refpurpose>calcule la représentation en base 2 (mantisse et exposant) d'un nombre décimal
+            <emphasis role="bold">(dépréciée)</emphasis>
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>[f,e]=frexp(x)</synopsis>
+        <synopsis>[f, e] = frexp(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>frexp()</literal> devient une fonction interne à compter de Scilab 6.1.x.
+            SVP utiliser désormais <literal>[f,e] = log2(x)</literal> à la place.
+        </warning>
         <para>Cette fonction correspond à la fonction ANSI C frexp(). Chaque 0
             dans <literal>x</literal> produit <literal>f=0</literal> et
             <literal>e=0</literal>.
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    frexp() devient une fonction interne. Elle est publiquement remplacée par
+                    [f,e]=log2(x).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
diff --git a/scilab/modules/elementary_functions/help/ja_JP/exponential/log2.xml b/scilab/modules/elementary_functions/help/ja_JP/exponential/log2.xml
deleted file mode 100644 (file)
index 7072ac6..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="ja">
-
-    <refnamediv>
-
-        <refname>log2</refname>
-
-        <refpurpose>2を底とする対数</refpurpose>
-
-    </refnamediv>
-
-    <refsynopsisdiv>
-
-        <title>呼び出し手順</title>
-
-        <synopsis>y=log2(x)</synopsis>
-
-    </refsynopsisdiv>
-
-    <refsection>
-
-        <title>引数</title>
-
-        <variablelist>
-
-            <varlistentry>
-
-                <term>x</term>
-
-                <listitem>
-
-                    <para>ベクトルまたは行列</para>
-
-                </listitem>
-
-            </varlistentry>
-
-        </variablelist>
-
-    </refsection>
-
-    <refsection>
-
-        <title>説明</title>
-
-        <para>
-
-            <literal>log2(x)</literal> は,2を底とする"要素毎"の対数
-
-            <literal>y(i,j)=log2(x(i,j))</literal>です.
-
-        </para>
-
-    </refsection>
-
-    <refsection>
-
-        <title>例</title>
-
-        <programlisting role="example"><![CDATA[
-2.^log2([1,%i,-1,-%i])
- ]]></programlisting>
-
-    </refsection>
-
-    <refsection role="see also">
-
-        <title>参照</title>
-
-        <simplelist type="inline">
-
-            <member>
-
-                <link linkend="log">log</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="hat">hat</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="ieee">ieee</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="log10">log10</link>
-
-            </member>
-
-            <member>
-
-                <link linkend="frexp">frexp</link>
-
-            </member>
-
-        </simplelist>
-
-    </refsection>
-
-</refentry>
-
index fe39c3d..c9b9b74 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * along with this program.
  *
  -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="ja">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="ja">
     <refnamediv>
-
         <refname>frexp</refname>
-
         <refpurpose>
-
             浮動小数点数を2を基底とする指数部と仮数部に分解する
-
+            <emphasis role="bold">(deprecated)</emphasis>
         </refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
-        <synopsis>[f,e]=frexp(x)</synopsis>
-
+        <synopsis>[f, e] = frexp(x)</synopsis>
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>x</term>
-
                 <listitem>
-
                     <para>実数のベクトルまたは行列</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>f</term>
-
                 <listitem>
-
                     <para>実数の値の配列, 通常は 0.5 &lt;= abs(f) の範囲
-
                         &lt; 1.
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>e</term>
-
                 <listitem>
-
                     <para>
-
                         以下の式を満たす整数の配列: <literal>x =
-
                             f.*2.^e
-
                         </literal>
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
+        <warning>
+            <literal>frexp()</literal> becomes an internal function in Scilab 6.1.x.
+            Please use <literal>[f,e] = log2(x)</literal> instead.
+        </warning>
         <para>この関数は ANSI C 関数 frexp()に一致します.
-
             <literal>x</literal>の中の 0 は <literal>f=0</literal> かつ
-
             <literal>e=0</literal>となります.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
 [f,e]=frexp([1,%pi,-3,%eps])
  ]]></programlisting>
-
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
                 <link linkend="log">log</link>
-
             </member>
-
             <member>
-
                 <link linkend="hat">hat</link>
-
             </member>
-
             <member>
-
                 <link linkend="ieee">ieee</link>
-
             </member>
-
             <member>
-
                 <link linkend="log2">log2</link>
-
             </member>
-
         </simplelist>
-
     </refsection>
-
-</refentry>
-
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    frexp() becomes internal. It is publicly replaced with [f,e]=log2(x).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index d8157ea..46da32f 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="ja">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="ja">
     <refnamediv>
-
         <refname>nearfloat</refname>
-
         <refpurpose>前のまたは次の浮動小数点数を取得</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
         <synopsis>xnear = nearfloat(dir, x)</synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>dir</term>
-
                 <listitem>
-
                     <para>文字列 ("succ" または "pred")</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>x</term>
-
                 <listitem>
-
                     <para>実数のスカラー, ベクトルまたは行列</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>xnear</term>
-
                 <listitem>
-
                     <para>実数のスカラー, ベクトルまたは行列</para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             この関数は要素毎に
-
             <literal>x</literal>の要素の(浮動小数点数の集合の意味で)隣にある要素
-
             (number_properties参照)を計算します.
-
             <literal>dir = "succ"</literal>の場合は次の要素,
-
             <literal>dir = "pred".</literal>の場合は前の要素となります.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
 format("e",22)
 nearfloat("succ",1) - 1
 1 - nearfloat("pred",1)
 format("v") //デフォルトの形式にリセット
  ]]></programlisting>
-
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
                 <link linkend="number_properties">number_properties</link>
-
             </member>
-
             <member>
-
-                <link linkend="frexp">frexp</link>
-
+                <link linkend="log2">log2</link>
             </member>
-
         </simplelist>
-
     </refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
index 1ee5017..f074b25 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * along with this program.
  *
  -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="ja">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="ja">
     <refnamediv>
-
         <refname>nextpow2</refname>
-
         <refpurpose>指定値を超える2の累乗の最小値</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
-        <synopsis>t=nextpow2(x)</synopsis>
-
+        <synopsis>t = nextpow2(x)</synopsis>
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>x</term>
-
                 <listitem>
-
                     <para>実数のベクトルまたは行列</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>p</term>
-
                 <listitem>
-
                     <para>整数のベクトルまたは行列</para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             <literal>x</literal> がスカラーの場合, <literal>nextpow2(x)</literal>
-
             <literal>2^p &gt;=abs(x)</literal>となるような<literal>p</literal>
-
             を返します.
-
             <literal>x</literal> がベクトルまたは行列の場合,
-
             <literal>nextpow2(x)</literal> が要素毎に適用されます.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
 nextpow2(127)
 nextpow2(128)
 nextpow2(0:10)
  ]]></programlisting>
-
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
-                <link linkend="frexp">frexp</link>
-
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="bitstring">bitstring</link>
             </member>
-
         </simplelist>
-
     </refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
index 4bbea7a..f332a13 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="ja">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="ja">
     <refnamediv>
-
         <refname>number_properties</refname>
-
         <refpurpose>浮動小数点数パラメータを定義する</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順Syntax</title>
-
         <synopsis>pr = number_properties(prop)</synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>prop</term>
-
                 <listitem>
-
                     <para>文字列</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>pr</term>
-
                 <listitem>
-
                     <para>実数または論理値のスカラー</para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>この関数は
-
             <literal>F(b,p,emin,emax)</literal>で定義された
-
             浮動小数点数の集合
-
             (通常は IEEE 754 で定義された64bit浮動小数点数の集合)
-
             の数値的特徴を取得する際に使用することができます.
-
             <literal>F</literal> の数値は以下のように作成されます:
-
         </para>
-
         <para>
-
             <code>sign * m * b^e</code>
-
         </para>
-
         <para>
-
             <literal>e</literal>は指数, <literal>m</literal> は仮数です:
-
         </para>
-
         <latex>
-
             $$
-
             m = d_1 \cdot b^{-1} + d_2 \cdot b^{-2} + \ldots + d_p \cdot b^{-p}
-
             $$
-
         </latex>
-
         <para>
-
             <latex>$d_i$</latex> の桁は<literal>[0, b-1]</literal>の範囲,
-
             <literal>e</literal> は <literal>[emin, emax]</literal>の範囲となり,
-
             <latex>$d_1 \neq 0$</latex>の場合,
-
             数値は"正規化"されます.
-
             以下の値を取得できます:
-
         <variablelist>
-
             <varlistentry>
-
                 <term>prop = "radix"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合, <literal>pr</literal> は
-
                         集合 <literal>F</literal>の基数<literal>b</literal>となります
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "digits"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合, <literal>pr</literal> は
-
                         <literal>p</literal>の桁数になります
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "huge"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合,<literal>pr</literal> は
-
                         <literal>F</literal>の最大の正の浮動小数点数となります
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "tiny"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合,<literal>pr</literal> は
-
                         <literal>F</literal>の正規化された最小の正の浮動小数点数となります
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "denorm"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合,<literal>pr</literal> は論理値となります
-
                         (正規化されていない数値が使用されている場合は %t)
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "tiniest"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合,<literal>pr</literal>が
-
                         最小の正の非正規化数の場合に  denorm = %t,
-
                         そうでない場合に <literal>pr</literal> = tiny となります
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "eps"</term>
-
                 <listitem>
-
                     <para>この場合,
-
                         <literal>pr</literal> は,機械イプシロン
-
                         (通常は <latex>$\dfrac{b^{1-p}}{2}$</latex>)となります.
-
                         機械イプシロンは,
-
                         (<literal>|x|</literal> が <literal>[tiny, huge]</literal>の範囲にあるような)
-
                         <literal>x</literal>と<literal>F</literal>における
-
                         浮動小数点近似である<literal>fl(x)</literal>の間の
-
                         相対誤差の最大値です.
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "minexp"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合, <literal>pr</literal> は <literal>emin</literal>です
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>prop = "maxexp"</term>
-
                 <listitem>
-
                     <para>
-
                         この場合, <literal>pr</literal> は <literal>emax</literal>です
-
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
       </para>
       <note>
-
             この関数は機械パラメータを取得するために
-
             LAPACKルーチン dlamch を使用します.
-
             (名前 (radix, digit, huge, など...) は LIA 1 規格で推奨されたもので,
-
             対応する Lapack の定義とは異なっています) ;
-
         </note>
-
         <warning>
-
             機械イプシロンに関して以下のような定義を見ることが
-
             あるはずです: <latex>$eps = b^{1-p}$</latex>
-
             しかし, この関数では伝統的な定義 (前記のprop = "eps"を参照)を
-
             使用しており,
-
             このため,通常の丸めが発生する場合に<latex>$eps = \dfrac{b^{1-p}}{2}$</latex>
-
             ,そうでない場合に <latex>$eps = b^{1-p}$</latex>
-
             となります.
-
         </warning>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
 b = number_properties("radix")
 eps = number_properties("eps")
  ]]></programlisting>
-
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
                 <link linkend="nearfloat">nearfloat</link>
-
             </member>
-
             <member>
-
-                <link linkend="frexp">frexp</link>
-
+                <link linkend="log2">log2</link>
             </member>
-
         </simplelist>
-
     </refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
diff --git a/scilab/modules/elementary_functions/help/pt_BR/exponential/log2.xml b/scilab/modules/elementary_functions/help/pt_BR/exponential/log2.xml
deleted file mode 100644 (file)
index c4bb5ab..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="pt">
-    <refnamediv>
-        <refname>log2</refname>
-        <refpurpose>logaritmo na base 2</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>y=log2(x)</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>vetor ou matriz </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            Logaritmo na base 2. Se <literal>x</literal> é um vetor
-            <literal>log2(x)=[log2(x1),...,log2(xn)]</literal>.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemplos </title>
-        <programlisting role="example"><![CDATA[
-2.^log2([1,%i,-1,-%i])
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="log">log</link>
-            </member>
-            <member>
-                <link linkend="hat">hat</link>
-            </member>
-            <member>
-                <link linkend="ieee">ieee</link>
-            </member>
-            <member>
-                <link linkend="log10">log10</link>
-            </member>
-            <member>
-                <link linkend="frexp">frexp</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
index 47e7d5a..3d390b0 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="pt">
     <refnamediv>
         <refname>frexp</refname>
-        <refpurpose>separa um número em ponto flutuante em potência de base 2 e
-            mantissa
+        <refpurpose>separa um número em ponto flutuante em potência de base 2 e mantissa
+            <emphasis role="bold">(deprecated)</emphasis>
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
-        <synopsis>[f,e]=frexp(x)</synopsis>
+        <synopsis>[f, e] = frexp(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Parâmetros</title>
     </refsection>
     <refsection>
         <title>Descrição</title>
+        <warning>
+            <literal>frexp()</literal> becomes an internal function in Scilab 6.1.x.
+            Please use <literal>[f,e] = log2(x)</literal> instead.
+        </warning>
         <para>Esta função corresponde à função ANSI C frexp(). Quaisquer zeros em
             <literal>x</literal> produzem <literal>f=0</literal> e
             <literal>e=0</literal>.
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    frexp() becomes internal. It is publicly replaced with [f,e]=log2(x).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 891bf64..35e1e28 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="pt">
     <refnamediv>
         <refname>nearfloat</refname>
         <refpurpose>get previous or next floating-point number</refpurpose>
@@ -57,7 +60,7 @@ format("v") //retoma o formato padrão
                 <link linkend="number_properties">number_properties</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index 5ad8e57..2074110 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="pt">
     <refnamediv>
         <refname>nextpow2</refname>
         <refpurpose>próxima potência de 2 mais alta </refpurpose>
@@ -62,7 +65,13 @@ nextpow2(0:10)
         <title>Ver Também</title>
         <simplelist type="inline">
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="bitstring">bitstring</link>
             </member>
         </simplelist>
     </refsection>
index 9daaf99..0dc26b7 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="pt">
     <refnamediv>
         <refname>number_properties</refname>
         <refpurpose>determina parâmetros de ponto flutuante</refpurpose>
@@ -164,7 +167,7 @@ eps = number_properties("eps")
                 <link linkend="nearfloat">nearfloat</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index 4ae59a5..a882765 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="log2" xml:lang="ru">
     <refnamediv>
         <refname>log2</refname>
         <refpurpose>логарифм по основанию 2</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>y=log2(x)</synopsis>
+        <synopsis>
+            y = log2(x)
+            [f, e] = log2(u)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
         <variablelist>
             <varlistentry>
-                <term>x</term>
+                <term>x, y</term>
                 <listitem>
-                    <para>вектор или матрица</para>
+                    <para>
+                        массивы десятичных или комплексных чисел, такие, что <literal>2.^y = x</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>u, m, e</term>
+                <listitem>
+                    <para>
+                        массивы десятичных чисел, такие, что <literal>u = m .* 2.^e</literal>,
+                        при <literal>sign(m)=sign(u)</literal> и <literal>0.5 ≤ abs(m) &lt; 1</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <title>Описание</title>
         <para>
             <literal>log2(x)</literal> является поэлементным логарифмом по основанию 2
-            <literal>y(i,j)=log2(x(i,j))</literal>.
+            <literal>y(i,j) = log2(x(i,j))</literal>.
+            <note>
+                <literal>log2(-%inf) == %inf + log2(-1)</literal>
+            </note>
+        </para>
+        <para>
+            <literal>[m,e]=log2(u)</literal> вычисляет поэлементно мантиссу по основанию 2
+            <varname>m</varname> и экспоненту <varname>e</varname> каждого элемента
+            <varname>u</varname>. Следовательно, для любого индекса <literal>k</literal> имеем
+            <literal>u(k) = m(k) .* 2.^e(k)</literal> при <literal>0.5 ≤ |m(k)| &lt; 1</literal>.
+            <note>
+                <itemizedlist>
+                    <listitem>
+                        <literal>[m,e]=log2([0 %nan -%inf %inf])</literal> возвращает
+                        <literal>m=[0  NaN -Inf Inf]</literal> и <literal>e=[0 0 0 0]</literal>.
+                    </listitem>
+                    <listitem>
+                        Этот синтаксис соответствует функции frexp() ANSI C.
+                    </listitem>
+                </itemizedlist>
+            </note>
         </para>
     </refsection>
     <refsection>
         <title>Примеры</title>
+        <para>
+            Логарифм по основанию 2:
+        </para>
+        <programlisting role="example"><![CDATA[
+L = log2([-1, 1, 2, %i, -%i])
+clean(2.^L)
+L = log2([0 %nan %inf])
+2 .^ L
+L = log2([0 %nan %inf -%inf]) // -%inf<0 превращает результат в комплексный вид
+2 .^ L                        // -Inf не получится
+ ]]></programlisting>
+    <screen><![CDATA[
+--> L = log2([-1, 1, 2, %i, -%i])
+ L  =
+   4.5323601i   0.   1.   2.2661801i  -2.2661801i
+
+--> clean(2.^L)
+ ans  =
+  -1.   1.   2.   i   -i
+
+--> L = log2([0 %nan %inf])
+ L  =
+  -Inf   Nan   Inf
+
+--> 2 .^ L
+ ans  =
+   0.   Nan   Inf
+
+--> L = log2([0 %nan %inf -%inf]) // -%inf<0 превращает результат в комплексный вид
+ L  =
+  -Inf   Nan + Nani   Inf   Inf + 4.5323601i
+
+--> 2 .^ L                        // -Inf не получится
+ ans  =
+   0.   Nan + Nani   Inf   Nan + Nani
+]]></screen>
+        <para/>
+        <para>
+            Разложение на мантиссу по основанию 2 + экспоненту:
+        </para>
         <programlisting role="example"><![CDATA[
-2.^log2([1,%i,-1,-%i])
+[m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+m .* 2.^e
  ]]></programlisting>
+    <screen><![CDATA[
+--> [m, e] = log2([-3, -1.5, -1, 0, 4, 1e20])
+ e  =
+   2.     1.     1.    0.   3.   67.
+ m  =
+  -0.75  -0.75  -0.5   0.   0.5   0.6776264
+
+--> m .* 2.^e
+ ans  =
+  -3.  -1.5  -1.   0.   4.   1.000D+20
+]]></screen>
+    <para/>
+        <programlisting role="example"><![CDATA[
+np = number_properties;
+x = [%eps np("tiniest") np("tiny") np("huge")]
+[m, e] = log2(x)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> x = [%eps np("tiniest") np("tiny") np("huge")]
+ x  =
+    2.220D-16    4.94D-324    2.22D-308    1.79D+308
+
+--> [m, e] = log2(x)
+ e  =
+  - 51.  - 1073.  - 1021.    1024.
+ m  =
+    0.5    0.5    0.5    1.
+]]></screen>
+    <para/>
+        <programlisting role="example"><![CDATA[
+[m, e] = log2([0 %nan -%inf %inf])
+m .* 2.^e
+ ]]></programlisting>
+    <screen><![CDATA[
+-->[m, e] = log2([0 %nan -%inf %inf])
+ e  =
+    0.    0.    0.    0.
+ m  =
+    0.    Nan  - Inf    Inf
+
+-->m .* 2.^e
+ ans  =
+    0.    Nan  - Inf    Inf
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Смотрите также</title>
                 <link linkend="log">log</link>
             </member>
             <member>
-                <link linkend="hat">hat</link>
+                <link linkend="log10">log10</link>
             </member>
             <member>
-                <link linkend="ieee">ieee</link>
+                <link linkend="nextpow2">nextpow2</link>
             </member>
             <member>
-                <link linkend="log10">log10</link>
+                <link linkend="bitstring">bitstring</link>
+            </member>
+            <member>
+                <link linkend="hat">hat</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="ieee">ieee</link>
             </member>
         </simplelist>
     </refsection>
index 4a798cc..716a8b2 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="frexp" xml:lang="ru">
     <refnamediv>
         <refname>frexp</refname>
-        <refpurpose>делит числа с плавающей запятой на показатель по основанию 2 и мантиссу</refpurpose>
+        <refpurpose>делит числа с плавающей запятой на показатель по основанию 2 и мантиссу
+            <emphasis role="bold">(устарело)</emphasis>
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>[f,e]=frexp(x)</synopsis>
+        <synopsis>[f, e] = frexp(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
     </refsection>
     <refsection>
         <title>Описание</title>
+        <warning>
+            <literal>frexp()</literal> становится внутренней функцией в Scilab 6.1.x.
+            Пожалуйста, используйте вместо неё <literal>[f,e] = log2(x)</literal>.
+        </warning>
         <para>Эта функция соответствует функции C ANSI frexp(). Любые нули в
             <literal>x</literal> производят <literal>f=0</literal> и
             <literal>e=0</literal>.
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    frexp() становится внутренней. Она публично заменена функцией [f,e]=log2(x).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 0f8ba18..691983f 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nearfloat" xml:lang="ru">
     <refnamediv>
         <refname>nearfloat</refname>
         <refpurpose>
         <para>
             Эта функция вычисляет, в поэлементном смысле, соответствующих соседей
             элементов <literal>x</literal> (см. number_properties в нижеследующем
-            наборе с плавающей точкой), последующие элементы, если <literal>dir =
-                "succ"
-            </literal>
-            ,и предыдущие элементы, если <literal>dir =
-                "pred"
-            </literal>
-            .
+            наборе с плавающей точкой), последующие элементы, если
+            <literal>dir ="succ"</literal>, и предыдущие элементы, если
+            <literal>dir = "pred"</literal>.
         </para>
     </refsection>
     <refsection>
@@ -53,7 +52,7 @@
 format("e",22)
 nearfloat("succ",1) - 1
 1 - nearfloat("pred",1)
-format("v") //reset default format
+format("v") //сброс к формату по умолчанию
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -63,7 +62,7 @@ format("v") //reset default format
                 <link linkend="number_properties">number_properties</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index 61ec0b8..7deda5b 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="nextpow2" xml:lang="ru">
     <refnamediv>
         <refname>nextpow2</refname>
         <refpurpose>степень двойки, дающая равное или большее число</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>t=nextpow2(x)</synopsis>
+        <synopsis>t = nextpow2(x)</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
@@ -61,7 +64,13 @@ nextpow2(0:10)
         <title>Смотрите также</title>
         <simplelist type="inline">
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="bitstring">bitstring</link>
             </member>
         </simplelist>
     </refsection>
index 5d271d4..f8f253b 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="number_properties" xml:lang="ru">
     <refnamediv>
         <refname>number_properties</refname>
         <refpurpose>определение параметров чисел с плавающей запятой</refpurpose>
         </note>
         <warning>
             иногда вы можете увидеть следующее определение машинного эпсилона:
-            <latex>$eps = b^{1-p}$</latex>,но в этой функции мы используем традиционное определение
-            (см. выше prop = "eps") и поэтому <latex>$eps = \dfrac{b^{1-p}}{2}$</latex>
-            , если производится нормальное округление, а
-            если нет, то <latex>$eps = b^{1-p}$</latex>.
+            <latex>$eps = b^{1-p}$</latex>, но в этой функции мы используем традиционное определение
+            (см. выше prop = "eps") и поэтому <latex>$eps = \dfrac{b^{1-p}}{2}$</latex>, если
+            производится нормальное округление, а если нет, то <latex>$eps = b^{1-p}$</latex>.
         </warning>
     </refsection>
     <refsection>
@@ -168,7 +170,7 @@ eps = number_properties("eps")
                 <link linkend="nearfloat">nearfloat</link>
             </member>
             <member>
-                <link linkend="frexp">frexp</link>
+                <link linkend="log2">log2</link>
             </member>
         </simplelist>
     </refsection>
index 17557ea..cd13c32 100644 (file)
@@ -1,8 +1,8 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) INRIA
 // Copyright (C) DIGITEO - 2011 - Allan CORNET
-//
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2019 - Samuel GOUGEON
 //
 // This file is hereby licensed under the terms of the GNU GPL v2.0,
 // pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -21,6 +21,16 @@ function [f, e] = log2(x)
     if argn(1) == 1 then
         f = log(x) / log(2)
     else
+        if type(x)<>1
+            msg = gettext("%s: Argument #%d: Decimal numbers expected.\n")
+            error(msprintf(msg, "log2", 1))
+        end
+        if ~isreal(x,0)
+            msg = gettext("%s: Argument #%d: Complex numbers not supported.\n")
+            error(msprintf(msg, "log2", 1))
+        else
+            x = real(x)
+        end
         [f, e] = frexp(x)
     end
 endfunction
index 2936c92..17125e7 100644 (file)
@@ -21,7 +21,7 @@ function e = nextpow2(n)
     kf = find(~isnan(n)&n<>%inf);
     e = n;
     f = zeros(n);
-    [f(kf), e(kf)] = frexp(n(kf));
+    [f(kf), e(kf)] = log2(n(kf));
     k = find(f==0.5); // n(k) is a power of 2
     if ~isempty(k)
         e(k) = e(k)-1;
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_10521.dia.ref b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_10521.dia.ref
deleted file mode 100644 (file)
index ad2c88b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2012 - DIGITEO - Allan CORNET
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- CLI SHELL MODE -->
-//
-// <-- Non-regression test for bug 10521 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=10521
-//
-// <-- Short Description -->
-// frexp returned an error
-//
-[f, e] = frexp([1,%pi,-3,%eps]);
-e_ref = [1.    2.    2.  -51.];
-assert_checkequal(e, e_ref);
index a0d6d34..8fbb223 100644 (file)
@@ -6,17 +6,17 @@
 // =============================================================================
 //
 // <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
 //
 // <-- Non-regression test for bug 10521 -->
 //
 // <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=10521
+// http://bugzilla.scilab.org/10521
 //
 // <-- Short Description -->
-// frexp returned an error
+// [f,e] = log2(x) returned an error
 //
 
-[f, e] = frexp([1,%pi,-3,%eps]);
+[f, e] = log2([1,%pi,-3,%eps]);
 e_ref = [1.    2.    2.  -51.];
 assert_checkequal(e, e_ref);
-
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.dia.ref b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.dia.ref
deleted file mode 100644 (file)
index 26b9708..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2010 - DIGITEO - Allan CORNET
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- CLI SHELL MODE -->
-//
-// <-- Non-regression test for bug 6938 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=6938
-//
-// <-- Short Description -->
-// frexp returned a wrong message error with a complex as input argument.
-[f, e] = frexp([1, %pi, -3, %eps]);
-if or(size(e) <> [1 4]) then bugmes();quit;end
-if or(size(f) <> [1 4]) then bugmes();quit;end
-if or(e <> [1.    2.    2.  -51.]) then bugmes();quit;end
-if execstr("[f, e] = frexp();", "errcatch") <> 77 then bugmes();quit;end
-if execstr("[f] = frexp(%pi);", "errcatch") <> 78 then bugmes();quit;end
-if execstr("[f, e] = frexp(""a"");", "errcatch") <> 999 then bugmes();quit;end
-if execstr("[f, e] = frexp(%i);", "errcatch") <> 999 then bugmes();quit;end
-if lasterror() <> msprintf(_("%s: Wrong type for input argument #%d: Real matrix expected.\n"), "frexp", 1) then bugmes();quit;end
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.tst b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_6938.tst
deleted file mode 100644 (file)
index 06a9165..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2010 - DIGITEO - Allan CORNET
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- CLI SHELL MODE -->
-//
-// <-- Non-regression test for bug 6938 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=6938
-//
-// <-- Short Description -->
-// frexp returned a wrong message error with a complex as input argument.
-
-[f, e] = frexp([1, %pi, -3, %eps]);
-if or(size(e) <> [1 4]) then pause, end
-if or(size(f) <> [1 4]) then pause, end
-if or(e <> [1.    2.    2.  -51.]) then pause, end
-
-if execstr("[f, e] = frexp();", "errcatch") <> 77 then pause, end
-if execstr("[f] = frexp(%pi);", "errcatch") <> 78 then pause, end
-if execstr("[f, e] = frexp(""a"");", "errcatch") <> 999 then pause, end
-
-if execstr("[f, e] = frexp(%i);", "errcatch") <> 999 then pause, end
-if lasterror() <> msprintf(_("%s: Wrong type for input argument #%d: Real matrix expected.\n"), "frexp", 1) then pause, end
diff --git a/scilab/modules/elementary_functions/tests/unit_tests/log2.tst b/scilab/modules/elementary_functions/tests/unit_tests/log2.tst
new file mode 100644 (file)
index 0000000..cbcf83a
--- /dev/null
@@ -0,0 +1,29 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - DIGITEO - Allan CORNET
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
+//
+// Unitary tests of log2()
+// =======================
+
+
+// Base-2 mantissa + exponent decomposition:
+// ----------------------------------------
+[f, e] = log2([1, %pi, -3, %eps]);
+if or(size(e) <> [1 4]) then pause, end
+if or(size(f) <> [1 4]) then pause, end
+if or(e <> [1.    2.    2.  -51.]) then pause, end
+
+// Checking error messages
+msg = gettext("%s: Wrong number of input argument(s): %d expected.\n");
+assert_checkerror("[f, e] = log2();", msprintf(msg, "log2", 1));
+msg = gettext("%s: Argument #%d: Decimal numbers expected.\n");
+assert_checkerror("[f, e] = log2(""a"");", msprintf(msg, "log2", 1));
+msg = gettext("%s: Argument #%d: Complex numbers not supported.\n");
+assert_checkerror("[f, e] = log2(%i);", msprintf(msg, "log2", 1));
diff --git a/scilab/modules/m2sci/help/en_US/m2sci_equivalents/l/log2.xml b/scilab/modules/m2sci/help/en_US/m2sci_equivalents/l/log2.xml
deleted file mode 100644 (file)
index e52e833..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2009 - DIGITEO - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="m2sci_log2">
-    <refnamediv>
-        <refname>log2 (Matlab function)</refname>
-        <refpurpose>Base 2 logarithm and dissect floating point number</refpurpose>
-    </refnamediv>
-    <refsection>
-        <title>Matlab/Scilab equivalent</title>
-        <informaltable border="1" width="100%">
-            <tr>
-                <td align="center">
-                    <emphasis role="bold">Matlab</emphasis>
-                </td>
-                <td align="center">
-                    <emphasis role="bold">Scilab</emphasis>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    <programlisting role="example"><![CDATA[
-log2
-]]></programlisting>
-                </td>
-                <td>
-                    <programlisting role="example"><![CDATA[
-log2 - frexp
-]]></programlisting>
-                </td>
-            </tr>
-        </informaltable>
-    </refsection>
-    <refsection>
-        <title>Particular cases</title>
-        <para>
-            Scilab <emphasis role="bold">log2</emphasis> is equivalent to Matlab <emphasis role="bold">log2</emphasis> for logarithm computation, but for floating point number dissection, Scilab equivalent to Matlab <emphasis role="bold">log2</emphasis> is <emphasis role="bold">frexp</emphasis>.
-        </para>
-    </refsection>
-</refentry>
index ceeff83..1c1def8 100644 (file)
@@ -24,8 +24,8 @@ function [tree]=sci_log2(tree)
     // Y = log2(X)
     if lhs==1 then
         tree.lhs(1).infer=X.infer
-        // [F,E] = log2(X)
     else
+        // [F,E] = log2(X)
         if is_complex(X) then
             X = Funcall("real",1,list(X),list(Variable("",X.infer)))
         elseif ~is_real(X) then
@@ -34,7 +34,7 @@ function [tree]=sci_log2(tree)
             X=newX
         end
         tree.rhs=Rhs_tlist(X)
-        tree.name="frexp"
+        tree.name="log2"
         tree.lhs(1).dims=X.dims
         tree.lhs(1).type=Type(Double,Real)
     end
index 5c1c14d..99e4336 100644 (file)
@@ -93,16 +93,13 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     // TODO: get this list from a conf file
     std::unordered_map<std::wstring, std::wstring> map;
 
-    // Scilab 6.0.0 => 6.1.0
-    map.emplace(L"hypermat", L"matrix");
-    map.emplace(L"square", L"replot");
-
     // Scilab 6.0.x => 6.1.0
     map.emplace(L"dirname", L"fileparts");
     map.emplace(L"_d", L"_");
     map.emplace(L"dgettext", L"gettext");
     map.emplace(L"datatipToggle", L"datatipManagerMode");
     map.emplace(L"denom", L".den");
+    map.emplace(L"frexp", L"log2");
     map.emplace(L"getPreferencesValue", L"xmlGetValues");
     map.emplace(L"hypermat", L"zeros|matrix");
     map.emplace(L"lstsize", L"size");
index d9c984c..70cc712 100644 (file)
@@ -21,6 +21,6 @@ function [mu]=lin2mu(y)
     y = SCALE*y;
     sig = sign(y)+bool2s(y==0);
     y = min(abs(y),CLIP);
-    [f,e] = frexp(y+BIAS);
+    [f,e] = log2(y+BIAS);
     mu = 64*sig-16*e-fix(32*f)+OFFSET;
 endfunction