Skip to content

Commit e2ac58c

Browse files
committed
Remove mention of factorial as casting example. New example needed.
1 parent 04a4821 commit e2ac58c

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

doc/src/sgml/typeconv.sgml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.39 2003/11/29 19:51:38 pgsql Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.40 2003/12/01 21:53:15 momjian Exp $
33
-->
44

55
<chapter Id="typeconv">
@@ -437,30 +437,6 @@ SELECT @ '-4.5e500' AS "abs";
437437
ERROR: "-4.5e500" is out of range for type double precision
438438
</screen>
439439
</para>
440-
441-
<para>
442-
On the other hand, the postfix operator <literal>!</> (factorial)
443-
is defined only for integer data types, not for <type>float8</type>. So, if we
444-
try a similar case with <literal>!</>, we get:
445-
<screen>
446-
SELECT '20' ! AS "factorial";
447-
448-
ERROR: operator is not unique: "unknown" !
449-
HINT: Could not choose a best candidate operator. You may need to add explicit
450-
type casts.
451-
</screen>
452-
This happens because the system can't decide which of the several
453-
possible <literal>!</> operators should be preferred. We can help
454-
it out with an explicit cast:
455-
<screen>
456-
SELECT CAST('20' AS int8) ! AS "factorial";
457-
458-
factorial
459-
---------------------
460-
2432902008176640000
461-
(1 row)
462-
</screen>
463-
</para>
464440
</example>
465441

466442
</sect1>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy