annotate lisp/behavior-defs.el @ 5911:48386fd60fd0

GMP functions that take doubles choke on non-finite values, avoid that. src/ChangeLog addition: 2015-05-10 Aidan Kehoe <kehoea@parhasard.net> * floatfns.c (double_to_integer): Rename this from float_to_int to fit our newer, bignum-compatible terminology. GMP can signal SIGFPE when asked to turn NaN or infinity into a bignum, and we're not prepared to handle that signal if the OS float library routines don't do that, so check for those values explicitly. * floatfns.c (ceiling_two_float): * floatfns.c (ceiling_one_float): * floatfns.c (floor_two_float): * floatfns.c (floor_one_float): * floatfns.c (round_two_float): * floatfns.c (round_one_float): * floatfns.c (truncate_two_float): * floatfns.c (truncate_one_float): Call double_to_integer() with its new name. * number.c: Don't use the {bignum,ratio,bigfloat}_set_double functions directly here, with GMP they can choke when handed non-finite C doubles, call Ftruncate() and the new float_to_bigfloat() from floatfns.c. Maybe we should extend number-gmp.c with GMP-specific implementations that check for non-finite values. tests/ChangeLog addition: 2015-05-10 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Backslash a few parentheses in the first column for the sake of fontification. * automated/lisp-tests.el: Check that the rounding functions signal Lisp errors correctly when handed positive and negative infinity and NaN.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 10 May 2015 19:07:09 +0100
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
1 ;;; behavior-defs.el --- definitions of specific behaviors
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
2
2546
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
3 ;; Copyright (C) 2000, 2001, 2002, 2003 Ben Wing.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
4
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
5 ;; Author: Ben Wing
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
6 ;; Maintainer: XEmacs Development Team
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
7 ;; Keywords: internal, dumped
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
8
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
9 ;; This file is part of XEmacs.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
10
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
11 ;; XEmacs is free software: you can redistribute it and/or modify it
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
12 ;; under the terms of the GNU General Public License as published by the
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
13 ;; Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
14 ;; option) any later version.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
15
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
17 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
18 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
19 ;; for more details.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
20
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 2546
diff changeset
22 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
23
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
24 ;;; Synched up with: Not in FSF.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
25
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
26 ;;; Authorship:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
27
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
28 ;; Created July 2000 by Ben Wing.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
29
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
30 ;;; Commentary:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
31
2546
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
32 ;; This file is dumped with XEmacs.
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
33
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
34 ;;; Code:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
35
2546
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
36 (define-behavior-group 'tty)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
37 (define-behavior-group 'toolbars)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
38 (define-behavior-group 'menus)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
39 (define-behavior-group 'mouse)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
40 (define-behavior-group 'editing)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
41 (define-behavior-group 'keyboard)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
42 (define-behavior-group 'files)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
43 (define-behavior-group 'games)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
44 (define-behavior-group 'processes)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
45 (define-behavior-group 'display)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
46 (define-behavior-group 'programming)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
47 (define-behavior-group 'international)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
48 (define-behavior-group 'buffers-and-windows)
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
49 (define-behavior-group 'internet)
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents:
diff changeset
50
2546
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
51 (define-behavior 'compose-mail
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
52 "Not documented."
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
53 :group 'internet
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
54 :commands
5d1743698fb3 [xemacs-hg @ 2005-02-03 05:26:39 by ben]
ben
parents: 776
diff changeset
55 '(["Send %_Mail..." compose-mail]))