diff options
| author | Paul Eggert | 2015-03-24 11:42:53 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-03-24 11:43:21 -0700 |
| commit | 711770da9101a94ada42881cb86a976d323e9348 (patch) | |
| tree | 71465e72be54b14ec973cbf50a4a424449b31a07 /doc | |
| parent | 1e043f5e79bf67c9ebfa35623edcff0633d37a75 (diff) | |
| download | emacs-711770da9101a94ada42881cb86a976d323e9348.tar.gz emacs-711770da9101a94ada42881cb86a976d323e9348.zip | |
Fix minor ldexp issues
* doc/lispref/numbers.texi (Float Basics): Improve ldexp documentation.
* src/floatfns.c (Fldexp): Require 2 args. Avoid undefined behavior
if the exponent is out of 'int' range. Improve documentation.
Fixes: bug#20185
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/numbers.texi | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index a546306f9e4..9b1bbb357a5 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2015-03-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * numbers.texi (Float Basics): Improve ldexp documentation. | ||
| 4 | |||
| 1 | 2015-03-23 Eli Zaretskii <eliz@gnu.org> | 5 | 2015-03-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * commands.texi (Event Input Misc): Fix incorrect usage of @code. | 7 | * commands.texi (Event Input Misc): Fix incorrect usage of @code. |
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 8d1d3a798eb..7b4a0a6d407 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi | |||
| @@ -265,9 +265,15 @@ If @var{x} is a NaN, then @var{s} is also a NaN@. | |||
| 265 | If @var{x} is zero, then @var{e} is 0. | 265 | If @var{x} is zero, then @var{e} is 0. |
| 266 | @end defun | 266 | @end defun |
| 267 | 267 | ||
| 268 | @defun ldexp sig &optional exp | 268 | @defun ldexp s e |
| 269 | This function returns a floating-point number corresponding to the | 269 | Given a numeric significand @var{s} and an integer exponent @var{e}, |
| 270 | significand @var{sig} and exponent @var{exp}. | 270 | this function returns the floating point number |
| 271 | @ifnottex | ||
| 272 | @var{s} * 2**@var{e}. | ||
| 273 | @end ifnottex | ||
| 274 | @tex | ||
| 275 | @math{s 2^e}. | ||
| 276 | @end tex | ||
| 271 | @end defun | 277 | @end defun |
| 272 | 278 | ||
| 273 | @defun copysign x1 x2 | 279 | @defun copysign x1 x2 |