Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved documentation, moved to float.gd, added IsRealFloat filter, … #2016

Merged
merged 3 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 12 additions & 170 deletions doc/ref/floats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,85 +162,7 @@ false
]]></Example>
<P/>

<ManSection>
<Heading>Mathematical operations</Heading>
<Attr Name="Cos" Arg="x"/>
<Attr Name="Sin" Arg="x"/>
<Attr Name="SinCos" Arg="x"/>
<Attr Name="Tan" Arg="x"/>
<Attr Name="Sec" Arg="x"/>
<Attr Name="Csc" Arg="x"/>
<Attr Name="Cot" Arg="x"/>
<Attr Name="Asin" Arg="x"/>
<Attr Name="Acos" Arg="x"/>
<Attr Name="Atan" Arg="x"/>
<Oper Name="Atan2" Arg="y x"/>
<Attr Name="Cosh" Arg="x"/>
<Attr Name="Sinh" Arg="x"/>
<Attr Name="Tanh" Arg="x"/>
<Attr Name="Sech" Arg="x"/>
<Attr Name="Csch" Arg="x"/>
<Attr Name="Coth" Arg="x"/>
<Attr Name="Asinh" Arg="x"/>
<Attr Name="Acosh" Arg="x"/>
<Attr Name="Atanh" Arg="x"/>
<Oper Name="Log" Arg="x"/>
<Attr Name="Log2" Arg="x"/>
<Attr Name="Log10" Arg="x"/>
<Attr Name="Log1p" Arg="x"/>
<Attr Name="Exp" Arg="x"/>
<Attr Name="Exp2" Arg="x"/>
<Attr Name="Exp10" Arg="x"/>
<Attr Name="Expm1" Arg="x"/>
<Attr Name="CubeRoot" Arg="x"/>
<Attr Name="Square" Arg="x"/>
<Oper Name="Hypothenuse" Arg="x y"/>
<Attr Name="Ceil" Arg="x"/>
<Attr Name="Floor" Arg="x"/>
<Attr Name="Round" Arg="x"/>
<Attr Name="Trunc" Arg="x"/>
<Attr Name="Frac" Arg="x"/>
<Attr Name="SignFloat" Arg="x"/>
<Attr Name="Erf" Arg="x"/>
<Attr Name="Zeta" Arg="x"/>
<Attr Name="Gamma" Arg="x"/>
<Description>
Usual mathematical functions.
</Description>
</ManSection>

<ManSection>
<Oper Name="EqFloat" Arg="x y"/>
<Returns>Whether the floateans <A>x</A> and <A>y</A> are equal</Returns>
<Description>
This function compares two floating-point numbers, and returns
<K>true</K> if they are equal, and <K>false</K> otherwise; with the
exception that <K>NaN</K> is always considered to be different from
itself.
</Description>
</ManSection>

<ManSection>
<Attr Name="PrecisionFloat" Arg="x"/>
<Returns>The precision of <A>x</A></Returns>
<Description>
This function returns the precision, counted in number of binary digits,
of the floating-point number <A>x</A>.
</Description>
</ManSection>

<ManSection>
<Prop Name="IsPInfinity" Arg="x"/>
<Prop Name="IsNInfinity" Arg="x"/>
<Prop Name="IsXInfinity" Arg="x"/>
<Prop Name="IsFinite" Arg="x" Label="float"/>
<Prop Name="IsNaN" Arg="x"/>
<Description>
Returns <K>true</K> if the floating-point number <A>x</A> is
respectively <M>+\infty</M>, <M>-\infty</M>, <M>\pm\infty</M>,
finite, or `not a number', such as the result of <C>0.0/0.0</C>.
</Description>
</ManSection>
<#Include Label="Float">

<ManSection>
<Var Name="FLOAT" Label="constants"/>
Expand All @@ -267,7 +189,9 @@ false
</Description>
</ManSection>

<#Include Label="Float">
<#Include Label="Float-Extra">
<#Include Label="Float-Infinities">
<#Include Label="Float-Math-Commands">

</Section>

Expand Down Expand Up @@ -307,30 +231,18 @@ optional second argument requesting a precision in binary digits.

<Section><Heading>Complex arithmetic</Heading>

Complex arithmetic may be implemented in packages, and is present
in <Package>float</Package>. Complex numbers are treated as usual
numbers; they may be input with an extra "i" as in <C>-0.5+0.866i</C>.
Complex arithmetic may be implemented in packages, and is present in
<Package>float</Package>. Complex numbers are treated as usual
numbers; they may be input with an extra "i" as in
<C>-0.5+0.866i</C>. They may also be created using <Ref
Oper="NewFloat"/> with three arguments: the float filter, the real
part, and the imaginary part.
<P/>

Methods should then be implemented for <C>Norm</C>, <C>RealPart</C>,
<C>ImaginaryPart</C>, <C>ComplexConjugate</C>, ...

<ManSection>
<Attr Name="ComplexI" Arg="x"/>
<Description>
Returns a floatean with the same precision and representation,
whose value equals the imaginary unit <C>i</C>.
</Description>
</ManSection>

<ManSection>
<Attr Name="Argument" Arg="z" Label="for complex numbers" />
<Description>
Returns the argument of the complex number <A>z</A>.
<!-- Define what the argument is? -->
</Description>
</ManSection>

<#Include Label="Float-Complex">

</Section>

Expand All @@ -348,77 +260,7 @@ Note the usual convention that intervals are compared as
in <M>[a,b]\le[c,d]</M> if and only if <M>a\le c</M> and <M>b\le
d</M>.

<ManSection>
<Attr Name="Sup" Arg="interval"/>
<Description>
Returns the supremum of the interval.
</Description>
</ManSection>
<ManSection>
<Attr Name="Inf" Arg="interval"/>
<Description>
Returns the infimum of the interval.
</Description>
</ManSection>
<ManSection>
<Attr Name="Mid" Arg="interval"/>
<Description>
Returns the midpoint of the interval.
</Description>
</ManSection>
<ManSection>
<Attr Name="AbsoluteDiameter" Arg="interval"/>
<Description>
Returns the absolute diameter of the interval.
<!-- FIXME: what does that mean? -->
</Description>
</ManSection>
<ManSection>
<Attr Name="RelativeDiameter" Arg="interval"/>
<Description>
Returns the relative diameter of the interval.
<!-- FIXME: what does that mean? -->
</Description>
</ManSection>
<ManSection>
<Oper Name="Overlaps" Arg="interval1 interval2"/>
<Description>
Returns <K>true</K> if the two intervals overlap.
<!-- FIXME: is that correct? -->
</Description>
</ManSection>
<ManSection>
<Oper Name="IsDisjoint" Arg="interval1 interval2"/>
<Description>
Returns <K>true</K> if the two intervals are disjoint.
</Description>
</ManSection>
<ManSection>
<Oper Name="IsSubset" Arg="interval1 interval2" Label="for floatean intervals"/>
<Description>
Returns <K>true</K> if the first interval contains the second.
</Description>
</ManSection>
<ManSection>
<Oper Name="IncreaseInterval" Arg="interval delta"/>
<Description>
Returns an interval with same midpoint but absolute diameter increased by
<A>delta</A>.
</Description>
</ManSection>
<ManSection>
<Oper Name="BlowupInterval" Arg="interval ratio"/>
<Description>
Returns an interval with same midpoint but relative diameter increased by
<A>ratio</A>.
</Description>
</ManSection>
<ManSection>
<Oper Name="BisectInterval" Arg="interval"/>
<Description>
Returns a list of two intervals whose union equals <A>interval</A>.
</Description>
</ManSection>
<#Include Label="Float-Intervals">

</Section>

Expand Down
Loading