7990 | | if (x & C_FIXNUM_BIT) { |
7991 | | if (y & C_FIXNUM_BIT) { |
7992 | | return C_a_i_fixnum_times(ptr, 2, x, y); |
7993 | | } else if (C_immediatep(y)) { |
7994 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "*", y); |
7995 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
7996 | | return C_flonum(ptr, (double)C_unfix(x) * C_flonum_magnitude(y)); |
7997 | | } else if (C_truep(C_bignump(y))) { |
7998 | | return C_s_a_u_i_integer_times(ptr, 2, x, y); |
7999 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8000 | | return rat_times_integer(ptr, y, x); |
8001 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8002 | | return cplx_times(ptr, x, C_fix(0), |
8003 | | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
8004 | | } else { |
8005 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "*", y); |
8006 | | } |
8007 | | } else if (C_immediatep(x)) { |
8008 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "*", x); |
8009 | | } else if (C_block_header(x) == C_FLONUM_TAG) { |
8010 | | if (y & C_FIXNUM_BIT) { |
8011 | | return C_flonum(ptr, C_flonum_magnitude(x) * (double)C_unfix(y)); |
8012 | | } else if (C_immediatep(y)) { |
8013 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "*", y); |
8014 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8015 | | return C_a_i_flonum_times(ptr, 2, x, y); |
8016 | | } else if (C_truep(C_bignump(y))) { |
8017 | | return C_flonum(ptr, C_flonum_magnitude(x) * C_bignum_to_double(y)); |
8018 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8019 | | return C_s_a_i_times(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
8020 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8021 | | C_word ab[C_SIZEOF_FLONUM], *a = ab; |
8022 | | return cplx_times(ptr, x, C_flonum(&a, 0.0), |
8023 | | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
8024 | | } else { |
8025 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "*", y); |
8026 | | } |
8027 | | } else if (C_truep(C_bignump(x))) { |
8028 | | if (y & C_FIXNUM_BIT) { |
8029 | | return C_s_a_u_i_integer_times(ptr, 2, x, y); |
8030 | | } else if (C_immediatep(y)) { |
| 8046 | switch(C_dyadic_hash(C_type_hash(x), C_type_hash(y))) { |
| 8047 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8048 | return C_a_i_fixnum_times(ptr, 2, x, y); |
| 8049 | |
| 8050 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8051 | return C_flonum(ptr, (double)C_unfix(x) * C_flonum_magnitude(y)); |
| 8052 | |
| 8053 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8054 | return C_s_a_u_i_integer_times(ptr, 2, x, y); |
| 8055 | |
| 8056 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8057 | return rat_times_integer(ptr, y, x); |
| 8058 | |
| 8059 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8060 | return cplx_times(ptr, x, C_fix(0), |
| 8061 | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
| 8062 | |
| 8063 | |
| 8064 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8065 | return C_flonum(ptr, C_flonum_magnitude(x) * (double)C_unfix(y)); |
| 8066 | |
| 8067 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8068 | return C_a_i_flonum_times(ptr, 2, x, y); |
| 8069 | |
| 8070 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8071 | return C_flonum(ptr, C_flonum_magnitude(x) * C_bignum_to_double(y)); |
| 8072 | |
| 8073 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8074 | return C_s_a_i_times(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
| 8075 | |
| 8076 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8077 | { |
| 8078 | C_word ab[C_SIZEOF_FLONUM], *a = ab; |
| 8079 | return cplx_times(ptr, x, C_flonum(&a, 0.0), |
| 8080 | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
| 8081 | } |
| 8082 | |
| 8083 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8084 | return C_s_a_u_i_integer_times(ptr, 2, x, y); |
| 8085 | |
| 8086 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8087 | return C_flonum(ptr, C_bignum_to_double(x) * C_flonum_magnitude(y)); |
| 8088 | |
| 8089 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8090 | return C_s_a_u_i_integer_times(ptr, 2, x, y); |
| 8091 | |
| 8092 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8093 | return rat_times_integer(ptr, y, x); |
| 8094 | |
| 8095 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8096 | return cplx_times(ptr, x, C_fix(0), |
| 8097 | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
| 8098 | |
| 8099 | |
| 8100 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8101 | return rat_times_integer(ptr, x, y); |
| 8102 | |
| 8103 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8104 | return C_s_a_i_times(ptr, 2, C_a_i_exact_to_inexact(ptr, 1, x), y); |
| 8105 | |
| 8106 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8107 | return rat_times_integer(ptr, x, y); |
| 8108 | |
| 8109 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8110 | return rat_times_rat(ptr, x, y); |
| 8111 | |
| 8112 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8113 | return cplx_times(ptr, x, C_fix(0), |
| 8114 | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
| 8115 | |
| 8116 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8117 | return cplx_times(ptr, C_u_i_cplxnum_real(x), C_u_i_cplxnum_imag(x), |
| 8118 | C_u_i_cplxnum_real(y), C_u_i_cplxnum_imag(y)); |
| 8119 | |
| 8120 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8121 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8122 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8123 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8124 | { |
| 8125 | C_word ab[C_SIZEOF_FLONUM], *a = ab, yi; |
| 8126 | yi = C_truep(C_i_flonump(y)) ? C_flonum(&a,0) : C_fix(0); |
| 8127 | return cplx_times(ptr, C_u_i_ratnum_num(x), C_u_i_ratnum_denom(x), y, yi); |
| 8128 | } |
| 8129 | |
| 8130 | default: |
| 8131 | if (!C_truep(C_i_numberp(x))) |
8385 | | if (x & C_FIXNUM_BIT) { |
8386 | | if (y & C_FIXNUM_BIT) { |
8387 | | return C_a_i_fixnum_plus(ptr, 2, x, y); |
8388 | | } else if (C_immediatep(y)) { |
8389 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8390 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8391 | | return C_flonum(ptr, (double)C_unfix(x) + C_flonum_magnitude(y)); |
8392 | | } else if (C_truep(C_bignump(y))) { |
8393 | | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
8394 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8395 | | return rat_plusmin_integer(ptr, y, x, C_s_a_u_i_integer_plus); |
8396 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8397 | | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8398 | | imag = C_u_i_cplxnum_imag(y); |
8399 | | if (C_truep(C_u_i_inexactp(real_sum))) |
8400 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8401 | | return C_cplxnum(ptr, real_sum, imag); |
8402 | | } else { |
8403 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8404 | | } |
8405 | | } else if (C_immediatep(x)) { |
8406 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", x); |
8407 | | } else if (C_block_header(x) == C_FLONUM_TAG) { |
8408 | | if (y & C_FIXNUM_BIT) { |
8409 | | return C_flonum(ptr, C_flonum_magnitude(x) + (double)C_unfix(y)); |
8410 | | } else if (C_immediatep(y)) { |
8411 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8412 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8413 | | return C_a_i_flonum_plus(ptr, 2, x, y); |
8414 | | } else if (C_truep(C_bignump(y))) { |
8415 | | return C_flonum(ptr, C_flonum_magnitude(x)+C_bignum_to_double(y)); |
8416 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8417 | | return C_s_a_i_plus(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
8418 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8419 | | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8420 | | imag = C_u_i_cplxnum_imag(y); |
8421 | | if (C_truep(C_u_i_inexactp(real_sum))) |
8422 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8423 | | return C_cplxnum(ptr, real_sum, imag); |
8424 | | } else { |
8425 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8426 | | } |
8427 | | } else if (C_truep(C_bignump(x))) { |
8428 | | if (y & C_FIXNUM_BIT) { |
8429 | | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
8430 | | } else if (C_immediatep(y)) { |
8431 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8432 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8433 | | return C_flonum(ptr, C_bignum_to_double(x)+C_flonum_magnitude(y)); |
8434 | | } else if (C_truep(C_bignump(y))) { |
8435 | | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
8436 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8437 | | return rat_plusmin_integer(ptr, y, x, C_s_a_u_i_integer_plus); |
8438 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8439 | | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8440 | | imag = C_u_i_cplxnum_imag(y); |
8441 | | if (C_truep(C_u_i_inexactp(real_sum))) |
8442 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8443 | | return C_cplxnum(ptr, real_sum, imag); |
8444 | | } else { |
8445 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8446 | | } |
8447 | | } else if (C_block_header(x) == C_RATNUM_TAG) { |
8448 | | if (y & C_FIXNUM_BIT) { |
8449 | | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_plus); |
8450 | | } else if (C_immediatep(y)) { |
8451 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8452 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8453 | | return C_s_a_i_plus(ptr, 2, C_a_i_exact_to_inexact(ptr, 1, x), y); |
8454 | | } else if (C_truep(C_bignump(y))) { |
8455 | | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_plus); |
8456 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8457 | | return rat_plusmin_rat(ptr, x, y, C_s_a_u_i_integer_plus); |
8458 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8459 | | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8460 | | imag = C_u_i_cplxnum_imag(y); |
8461 | | if (C_truep(C_u_i_inexactp(real_sum))) |
8462 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8463 | | return C_cplxnum(ptr, real_sum, imag); |
8464 | | } else { |
8465 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "+", y); |
8466 | | } |
8467 | | } else if (C_block_header(x) == C_CPLXNUM_TAG) { |
8468 | | if (!C_immediatep(y) && C_block_header(y) == C_CPLXNUM_TAG) { |
| 8448 | switch(C_dyadic_hash(C_type_hash(x), C_type_hash(y))) { |
| 8449 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8450 | return C_a_i_fixnum_plus(ptr, 2, x, y); |
| 8451 | |
| 8452 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8453 | return C_flonum(ptr, (double)C_unfix(x) + C_flonum_magnitude(y)); |
| 8454 | |
| 8455 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8456 | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
| 8457 | |
| 8458 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8459 | return rat_plusmin_integer(ptr, y, x, C_s_a_u_i_integer_plus); |
| 8460 | |
| 8461 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8462 | { |
| 8463 | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8464 | imag = C_u_i_cplxnum_imag(y); |
| 8465 | if (C_truep(C_u_i_inexactp(real_sum))) |
| 8466 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8467 | return C_cplxnum(ptr, real_sum, imag); |
| 8468 | } |
| 8469 | |
| 8470 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8471 | return C_flonum(ptr, C_flonum_magnitude(x) + (double)C_unfix(y)); |
| 8472 | |
| 8473 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8474 | return C_a_i_flonum_plus(ptr, 2, x, y); |
| 8475 | |
| 8476 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8477 | return C_flonum(ptr, C_flonum_magnitude(x)+C_bignum_to_double(y)); |
| 8478 | |
| 8479 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8480 | return C_s_a_i_plus(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
| 8481 | |
| 8482 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8483 | { |
| 8484 | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8485 | imag = C_u_i_cplxnum_imag(y); |
| 8486 | if (C_truep(C_u_i_inexactp(real_sum))) |
| 8487 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8488 | return C_cplxnum(ptr, real_sum, imag); |
| 8489 | } |
| 8490 | |
| 8491 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8492 | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
| 8493 | |
| 8494 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8495 | return C_flonum(ptr, C_bignum_to_double(x)+C_flonum_magnitude(y)); |
| 8496 | |
| 8497 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8498 | return C_s_a_u_i_integer_plus(ptr, 2, x, y); |
| 8499 | |
| 8500 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8501 | return rat_plusmin_integer(ptr, y, x, C_s_a_u_i_integer_plus); |
| 8502 | |
| 8503 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8504 | { |
| 8505 | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8506 | imag = C_u_i_cplxnum_imag(y); |
| 8507 | if (C_truep(C_u_i_inexactp(real_sum))) |
| 8508 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8509 | return C_cplxnum(ptr, real_sum, imag); |
| 8510 | } |
| 8511 | |
| 8512 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8513 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8514 | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_plus); |
| 8515 | |
| 8516 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8517 | return C_s_a_i_plus(ptr, 2, C_a_i_exact_to_inexact(ptr, 1, x), y); |
| 8518 | |
| 8519 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8520 | return rat_plusmin_rat(ptr, x, y, C_s_a_u_i_integer_plus); |
| 8521 | |
| 8522 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8523 | { |
| 8524 | C_word real_sum = C_s_a_i_plus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8525 | imag = C_u_i_cplxnum_imag(y); |
| 8526 | if (C_truep(C_u_i_inexactp(real_sum))) |
| 8527 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8528 | return C_cplxnum(ptr, real_sum, imag); |
| 8529 | } |
| 8530 | |
| 8531 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8532 | { |
8596 | | if (x & C_FIXNUM_BIT) { |
8597 | | if (y & C_FIXNUM_BIT) { |
8598 | | return C_a_i_fixnum_difference(ptr, 2, x, y); |
8599 | | } else if (C_immediatep(y)) { |
8600 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8601 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8602 | | return C_flonum(ptr, (double)C_unfix(x) - C_flonum_magnitude(y)); |
8603 | | } else if (C_truep(C_bignump(y))) { |
8604 | | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
8605 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8606 | | return integer_minus_rat(ptr, x, y); |
8607 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8608 | | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8609 | | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
8610 | | if (C_truep(C_u_i_inexactp(real_diff))) |
8611 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8612 | | return C_cplxnum(ptr, real_diff, imag); |
8613 | | } else { |
8614 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8615 | | } |
8616 | | } else if (C_immediatep(x)) { |
8617 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", x); |
8618 | | } else if (C_block_header(x) == C_FLONUM_TAG) { |
8619 | | if (y & C_FIXNUM_BIT) { |
8620 | | return C_flonum(ptr, C_flonum_magnitude(x) - (double)C_unfix(y)); |
8621 | | } else if (C_immediatep(y)) { |
8622 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8623 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8624 | | return C_a_i_flonum_difference(ptr, 2, x, y); |
8625 | | } else if (C_truep(C_bignump(y))) { |
8626 | | return C_flonum(ptr, C_flonum_magnitude(x)-C_bignum_to_double(y)); |
8627 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8628 | | return C_s_a_i_minus(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
8629 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8630 | | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8631 | | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
8632 | | if (C_truep(C_u_i_inexactp(real_diff))) |
8633 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8634 | | return C_cplxnum(ptr, real_diff, imag); |
8635 | | } else { |
8636 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8637 | | } |
8638 | | } else if (C_truep(C_bignump(x))) { |
8639 | | if (y & C_FIXNUM_BIT) { |
8640 | | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
8641 | | } else if (C_immediatep(y)) { |
8642 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8643 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8644 | | return C_flonum(ptr, C_bignum_to_double(x)-C_flonum_magnitude(y)); |
8645 | | } else if (C_truep(C_bignump(y))) { |
8646 | | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
8647 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8648 | | return integer_minus_rat(ptr, x, y); |
8649 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8650 | | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8651 | | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
8652 | | if (C_truep(C_u_i_inexactp(real_diff))) |
8653 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8654 | | return C_cplxnum(ptr, real_diff, imag); |
8655 | | } else { |
8656 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8657 | | } |
8658 | | } else if (C_block_header(x) == C_RATNUM_TAG) { |
8659 | | if (y & C_FIXNUM_BIT) { |
8660 | | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_minus); |
8661 | | } else if (C_immediatep(y)) { |
8662 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", y); |
8663 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
8664 | | return C_s_a_i_minus(ptr, 2, C_a_i_exact_to_inexact(ptr, 1, x), y); |
8665 | | } else if (C_truep(C_bignump(y))) { |
8666 | | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_minus); |
8667 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
8668 | | return rat_plusmin_rat(ptr, x, y, C_s_a_u_i_integer_minus); |
8669 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
8670 | | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
8671 | | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
8672 | | if (C_truep(C_u_i_inexactp(real_diff))) |
8673 | | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
8674 | | return C_cplxnum(ptr, real_diff, imag); |
8675 | | } else { |
| 8670 | switch(C_dyadic_hash(C_type_hash(x), C_type_hash(y))) { |
| 8671 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8672 | return C_a_i_fixnum_difference(ptr, 2, x, y); |
| 8673 | |
| 8674 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8675 | return C_flonum(ptr, (double)C_unfix(x) - C_flonum_magnitude(y)); |
| 8676 | |
| 8677 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8678 | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
| 8679 | |
| 8680 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8681 | return integer_minus_rat(ptr, x, y); |
| 8682 | |
| 8683 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8684 | { |
| 8685 | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8686 | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
| 8687 | if (C_truep(C_u_i_inexactp(real_diff))) |
| 8688 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8689 | return C_cplxnum(ptr, real_diff, imag); |
| 8690 | } |
| 8691 | |
| 8692 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8693 | return C_flonum(ptr, C_flonum_magnitude(x) - (double)C_unfix(y)); |
| 8694 | |
| 8695 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8696 | return C_a_i_flonum_difference(ptr, 2, x, y); |
| 8697 | |
| 8698 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8699 | return C_flonum(ptr, C_flonum_magnitude(x)-C_bignum_to_double(y)); |
| 8700 | |
| 8701 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8702 | return C_s_a_i_minus(ptr, 2, x, C_a_i_exact_to_inexact(ptr, 1, y)); |
| 8703 | |
| 8704 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8705 | { |
| 8706 | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8707 | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
| 8708 | if (C_truep(C_u_i_inexactp(real_diff))) |
| 8709 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8710 | return C_cplxnum(ptr, real_diff, imag); |
| 8711 | } |
| 8712 | |
| 8713 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8714 | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
| 8715 | |
| 8716 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8717 | return C_flonum(ptr, C_bignum_to_double(x)-C_flonum_magnitude(y)); |
| 8718 | |
| 8719 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8720 | return C_s_a_u_i_integer_minus(ptr, 2, x, y); |
| 8721 | |
| 8722 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8723 | return integer_minus_rat(ptr, x, y); |
| 8724 | |
| 8725 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8726 | { |
| 8727 | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8728 | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
| 8729 | if (C_truep(C_u_i_inexactp(real_diff))) |
| 8730 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8731 | return C_cplxnum(ptr, real_diff, imag); |
| 8732 | } |
| 8733 | |
| 8734 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8735 | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_minus); |
| 8736 | |
| 8737 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8738 | return C_s_a_i_minus(ptr, 2, C_a_i_exact_to_inexact(ptr, 1, x), y); |
| 8739 | |
| 8740 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8741 | return rat_plusmin_integer(ptr, x, y, C_s_a_u_i_integer_minus); |
| 8742 | |
| 8743 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8744 | return rat_plusmin_rat(ptr, x, y, C_s_a_u_i_integer_minus); |
| 8745 | |
| 8746 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8747 | { |
| 8748 | C_word real_diff = C_s_a_i_minus(ptr, 2, x, C_u_i_cplxnum_real(y)), |
| 8749 | imag = C_s_a_i_negate(ptr, 1, C_u_i_cplxnum_imag(y)); |
| 8750 | if (C_truep(C_u_i_inexactp(real_diff))) |
| 8751 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8752 | return C_cplxnum(ptr, real_diff, imag); |
| 8753 | } |
| 8754 | |
| 8755 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 8756 | { |
| 8757 | C_word real_diff, imag_diff; |
| 8758 | real_diff = C_s_a_i_minus(ptr,2,C_u_i_cplxnum_real(x),C_u_i_cplxnum_real(y)); |
| 8759 | imag_diff = C_s_a_i_minus(ptr,2,C_u_i_cplxnum_imag(x),C_u_i_cplxnum_imag(y)); |
| 8760 | if (C_truep(C_u_i_zerop2(imag_diff))) return real_diff; |
| 8761 | else return C_cplxnum(ptr, real_diff, imag_diff); |
| 8762 | } |
| 8763 | |
| 8764 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 8765 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 8766 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 8767 | case C_dyadic_hash(C_CPLXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 8768 | { |
| 8769 | C_word real_diff = C_s_a_i_minus(ptr, 2, C_u_i_cplxnum_real(x), y), |
| 8770 | imag = C_u_i_cplxnum_imag(x); |
| 8771 | if (C_truep(C_u_i_inexactp(real_diff))) |
| 8772 | imag = C_a_i_exact_to_inexact(ptr, 1, imag); |
| 8773 | return C_cplxnum(ptr, real_diff, imag); |
| 8774 | } |
| 8775 | |
| 8776 | default: |
| 8777 | if (!C_truep(C_i_numberp(x))) |
| 8778 | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, "-", x); |
| 8779 | else |
9602 | | if (x & C_FIXNUM_BIT) { |
9603 | | if (y & C_FIXNUM_BIT) { |
9604 | | return C_fix((x < y) ? -1 : ((x > y) ? 1 : 0)); |
9605 | | } else if (C_immediatep(y)) { |
9606 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9607 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
9608 | | return int_flo_cmp(x, y); |
9609 | | } else if (C_truep(C_bignump(y))) { |
9610 | | C_word ab[C_SIZEOF_FIX_BIGNUM], *a = ab; |
9611 | | return C_i_bignum_cmp(C_a_u_i_fix_to_big(&a, x), y); |
9612 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
9613 | | if (eqp) return C_SCHEME_FALSE; |
9614 | | else return rat_cmp(x, y); |
9615 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
9616 | | if (eqp) return C_SCHEME_FALSE; |
9617 | | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
9618 | | } else { |
9619 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9620 | | } |
9621 | | } else if (C_immediatep(x)) { |
9622 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, x); |
9623 | | } else if (C_block_header(x) == C_FLONUM_TAG) { |
9624 | | if (y & C_FIXNUM_BIT) { |
9625 | | return flo_int_cmp(x, y); |
9626 | | } else if (C_immediatep(y)) { |
9627 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9628 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
9629 | | double a = C_flonum_magnitude(x), b = C_flonum_magnitude(y); |
9630 | | if (C_isnan(a) || C_isnan(b)) return C_SCHEME_FALSE; /* "mu" */ |
9631 | | else return C_fix((a < b) ? -1 : ((a > b) ? 1 : 0)); |
9632 | | } else if (C_truep(C_bignump(y))) { |
9633 | | return flo_int_cmp(x, y); |
9634 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
9635 | | return flo_rat_cmp(x, y); |
9636 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
9637 | | if (eqp) return C_SCHEME_FALSE; |
9638 | | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
9639 | | } else { |
9640 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9641 | | } |
9642 | | } else if (C_truep(C_bignump(x))) { |
9643 | | if (y & C_FIXNUM_BIT) { |
9644 | | C_word ab[C_SIZEOF_FIX_BIGNUM], *a = ab; |
9645 | | return C_i_bignum_cmp(x, C_a_u_i_fix_to_big(&a, y)); |
9646 | | } else if (C_immediatep(y)) { |
9647 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9648 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
9649 | | return int_flo_cmp(x, y); |
9650 | | } else if (C_truep(C_bignump(y))) { |
9651 | | return C_i_bignum_cmp(x, y); |
9652 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
9653 | | if (eqp) return C_SCHEME_FALSE; |
9654 | | else return rat_cmp(x, y); |
9655 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
9656 | | if (eqp) return C_SCHEME_FALSE; |
9657 | | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
9658 | | } else { |
9659 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9660 | | } |
9661 | | } else if (C_block_header(x) == C_RATNUM_TAG) { |
9662 | | if (y & C_FIXNUM_BIT) { |
9663 | | if (eqp) return C_SCHEME_FALSE; |
9664 | | else return rat_cmp(x, y); |
9665 | | } else if (C_immediatep(y)) { |
9666 | | barf(C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR, loc, y); |
9667 | | } else if (C_block_header(y) == C_FLONUM_TAG) { |
9668 | | return rat_flo_cmp(x, y); |
9669 | | } else if (C_truep(C_bignump(y))) { |
9670 | | if (eqp) return C_SCHEME_FALSE; |
9671 | | else return rat_cmp(x, y); |
9672 | | } else if (C_block_header(y) == C_RATNUM_TAG) { |
9673 | | if (eqp) { |
9674 | | return C_and(C_and(C_i_integer_equalp(C_u_i_ratnum_num(x), |
9675 | | C_u_i_ratnum_num(y)), |
9676 | | C_i_integer_equalp(C_u_i_ratnum_denom(x), |
9677 | | C_u_i_ratnum_denom(y))), |
9678 | | C_fix(0)); |
9679 | | } else { |
9680 | | return rat_cmp(x, y); |
9681 | | } |
9682 | | } else if (C_block_header(y) == C_CPLXNUM_TAG) { |
9683 | | if (eqp) return C_SCHEME_FALSE; |
9684 | | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
| 9689 | switch(C_dyadic_hash(C_type_hash(x), C_type_hash(y))) { |
| 9690 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 9691 | return C_fix((x < y) ? -1 : ((x > y) ? 1 : 0)); |
| 9692 | |
| 9693 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 9694 | return int_flo_cmp(x, y); |
| 9695 | |
| 9696 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 9697 | { |
| 9698 | C_word ab[C_SIZEOF_FIX_BIGNUM], *a = ab; |
| 9699 | return C_i_bignum_cmp(C_a_u_i_fix_to_big(&a, x), y); |
| 9700 | } |
| 9701 | |
| 9702 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 9703 | if (eqp) return C_SCHEME_FALSE; |
| 9704 | else return rat_cmp(x, y); |
| 9705 | |
| 9706 | case C_dyadic_hash(C_FIXNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 9707 | if (eqp) return C_SCHEME_FALSE; |
| 9708 | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
| 9709 | |
| 9710 | |
| 9711 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 9712 | return flo_int_cmp(x, y); |
| 9713 | |
| 9714 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 9715 | { |
| 9716 | double a = C_flonum_magnitude(x), b = C_flonum_magnitude(y); |
| 9717 | if (C_isnan(a) || C_isnan(b)) return C_SCHEME_FALSE; /* "mu" */ |
| 9718 | else return C_fix((a < b) ? -1 : ((a > b) ? 1 : 0)); |
| 9719 | } |
| 9720 | |
| 9721 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 9722 | return flo_int_cmp(x, y); |
| 9723 | |
| 9724 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 9725 | return flo_rat_cmp(x, y); |
| 9726 | |
| 9727 | case C_dyadic_hash(C_FLONUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 9728 | if (eqp) return C_SCHEME_FALSE; |
| 9729 | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
| 9730 | |
| 9731 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 9732 | { |
| 9733 | C_word ab[C_SIZEOF_FIX_BIGNUM], *a = ab; |
| 9734 | return C_i_bignum_cmp(x, C_a_u_i_fix_to_big(&a, y)); |
| 9735 | } |
| 9736 | |
| 9737 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 9738 | return int_flo_cmp(x, y); |
| 9739 | |
| 9740 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 9741 | return C_i_bignum_cmp(x, y); |
| 9742 | |
| 9743 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 9744 | if (eqp) return C_SCHEME_FALSE; |
| 9745 | else return rat_cmp(x, y); |
| 9746 | |
| 9747 | case C_dyadic_hash(C_BIGNUM_TYPE_HASH, C_CPLXNUM_TYPE_HASH): |
| 9748 | if (eqp) return C_SCHEME_FALSE; |
| 9749 | else barf(C_BAD_ARGUMENT_TYPE_COMPLEX_NO_ORDERING_ERROR, loc, y); |
| 9750 | |
| 9751 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FIXNUM_TYPE_HASH): |
| 9752 | if (eqp) return C_SCHEME_FALSE; |
| 9753 | else return rat_cmp(x, y); |
| 9754 | |
| 9755 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_FLONUM_TYPE_HASH): |
| 9756 | return rat_flo_cmp(x, y); |
| 9757 | |
| 9758 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_BIGNUM_TYPE_HASH): |
| 9759 | if (eqp) return C_SCHEME_FALSE; |
| 9760 | else return rat_cmp(x, y); |
| 9761 | |
| 9762 | case C_dyadic_hash(C_RATNUM_TYPE_HASH, C_RATNUM_TYPE_HASH): |
| 9763 | if (eqp) { |
| 9764 | return C_and(C_and(C_i_integer_equalp(C_u_i_ratnum_num(x), |
| 9765 | C_u_i_ratnum_num(y)), |
| 9766 | C_i_integer_equalp(C_u_i_ratnum_denom(x), |
| 9767 | C_u_i_ratnum_denom(y))), |
| 9768 | C_fix(0)); |