comparison src/floatfns.c @ 1995:4e6a63799f08

[xemacs-hg @ 2004-04-07 03:48:58 by james] Fix various ICC warnings and compilation errors.
author james
date Wed, 07 Apr 2004 03:49:00 +0000
parents 9c872f33ecbe
children fd0cbe945410
comparison
equal deleted inserted replaced
1994:cb7f3be19e9f 1995:4e6a63799f08
948 Fsignal (Qarith_error, Qnil); 948 Fsignal (Qarith_error, Qnil);
949 bignum_floor (scratch_bignum, XBIGNUM_DATA (number), 949 bignum_floor (scratch_bignum, XBIGNUM_DATA (number),
950 XBIGNUM_DATA (divisor)); 950 XBIGNUM_DATA (divisor));
951 return Fcanonicalize_number (make_bignum_bg (scratch_bignum)); 951 return Fcanonicalize_number (make_bignum_bg (scratch_bignum));
952 #endif 952 #endif
953 case FLOAT_T:
954 {
955 double f1 = extract_float (number);
956 double f2 = extract_float (divisor);
957
958 if (f2 == 0.0)
959 Fsignal (Qarith_error, Qnil);
960
961 IN_FLOAT2 (f1 = floor (f1 / f2), "floor", number, divisor);
962 return float_to_int (f1, "floor", number, divisor);
963 }
964 #ifdef HAVE_RATIO 953 #ifdef HAVE_RATIO
965 case RATIO_T: 954 case RATIO_T:
966 if (ratio_sign (XRATIO_DATA (divisor)) == 0) 955 if (ratio_sign (XRATIO_DATA (divisor)) == 0)
967 Fsignal (Qarith_error, Qnil); 956 Fsignal (Qarith_error, Qnil);
968 ratio_div (scratch_ratio, XRATIO_DATA (number), 957 ratio_div (scratch_ratio, XRATIO_DATA (number),
981 bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (number), 970 bigfloat_div (scratch_bigfloat, XBIGFLOAT_DATA (number),
982 XBIGFLOAT_DATA (divisor)); 971 XBIGFLOAT_DATA (divisor));
983 bigfloat_floor (scratch_bigfloat, scratch_bigfloat); 972 bigfloat_floor (scratch_bigfloat, scratch_bigfloat);
984 return make_bigfloat_bf (scratch_bigfloat); 973 return make_bigfloat_bf (scratch_bigfloat);
985 #endif 974 #endif
975 default: /* FLOAT_T */
976 {
977 double f1 = extract_float (number);
978 double f2 = extract_float (divisor);
979
980 if (f2 == 0.0)
981 Fsignal (Qarith_error, Qnil);
982
983 IN_FLOAT2 (f1 = floor (f1 / f2), "floor", number, divisor);
984 return float_to_int (f1, "floor", number, divisor);
985 }
986 } 986 }
987 } 987 }
988 #else /* !WITH_NUMBER_TYPES */ 988 #else /* !WITH_NUMBER_TYPES */
989 CHECK_INT_OR_FLOAT (number); 989 CHECK_INT_OR_FLOAT (number);
990 990