comparison src/floatfns.c @ 5595:63bc8a14a073

(Fffloor, Ffceil, Ffround, Fftruncate): New functions. (syms_of_floatfns): Turn them on.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Jan 1994 13:28:24 +0000
parents 87f9165f5b14
children 9fd25ec7204b
comparison
equal deleted inserted replaced
5594:f97415a8cf41 5595:63bc8a14a073
778 XSET (arg, Lisp_Int, (int) XFLOAT (arg)->data); 778 XSET (arg, Lisp_Int, (int) XFLOAT (arg)->data);
779 779
780 return arg; 780 return arg;
781 } 781 }
782 782
783 #if 0
784 /* It's not clear these are worth adding. */ 783 /* It's not clear these are worth adding. */
785 784
786 DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0, 785 DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
787 "Return the smallest integer no less than ARG, as a float.\n\ 786 "Return the smallest integer no less than ARG, as a float.\n\
788 \(Round toward +inf.\)") 787 \(Round toward +inf.\)")
809 "Return the nearest integer to ARG, as a float.") 808 "Return the nearest integer to ARG, as a float.")
810 (arg) 809 (arg)
811 register Lisp_Object arg; 810 register Lisp_Object arg;
812 { 811 {
813 double d = extract_float (arg); 812 double d = extract_float (arg);
814 IN_FLOAT (d = rint (XFLOAT (arg)->data), "fround", arg); 813 IN_FLOAT (d = rint (d), "fround", arg);
815 return make_float (d); 814 return make_float (d);
816 } 815 }
817 816
818 DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0, 817 DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0,
819 "Truncate a floating point number to an integral float value.\n\ 818 "Truncate a floating point number to an integral float value.\n\
826 IN_FLOAT (d = floor (d), "ftruncate", arg); 825 IN_FLOAT (d = floor (d), "ftruncate", arg);
827 else 826 else
828 IN_FLOAT (d = ceil (d), "ftruncate", arg); 827 IN_FLOAT (d = ceil (d), "ftruncate", arg);
829 return make_float (d); 828 return make_float (d);
830 } 829 }
831 #endif
832 830
833 #ifdef FLOAT_CATCH_SIGILL 831 #ifdef FLOAT_CATCH_SIGILL
834 static SIGTYPE 832 static SIGTYPE
835 float_error (signo) 833 float_error (signo)
836 int signo; 834 int signo;
928 defsubr (&Sbessel_jn); 926 defsubr (&Sbessel_jn);
929 defsubr (&Serf); 927 defsubr (&Serf);
930 defsubr (&Serfc); 928 defsubr (&Serfc);
931 defsubr (&Slog_gamma); 929 defsubr (&Slog_gamma);
932 defsubr (&Scube_root); 930 defsubr (&Scube_root);
931 #endif
933 defsubr (&Sfceiling); 932 defsubr (&Sfceiling);
934 defsubr (&Sffloor); 933 defsubr (&Sffloor);
935 defsubr (&Sfround); 934 defsubr (&Sfround);
936 defsubr (&Sftruncate); 935 defsubr (&Sftruncate);
937 #endif
938 defsubr (&Sexp); 936 defsubr (&Sexp);
939 defsubr (&Sexpt); 937 defsubr (&Sexpt);
940 defsubr (&Slog); 938 defsubr (&Slog);
941 defsubr (&Slog10); 939 defsubr (&Slog10);
942 defsubr (&Ssqrt); 940 defsubr (&Ssqrt);