diff --git a/c-backend.scm b/c-backend.scm index 2ef2337f..f5198c81 100644 --- a/c-backend.scm +++ b/c-backend.scm @@ -127,7 +127,12 @@ (gen "lf[" (first params) #\])) ) ) ((##core#float) - (gen (first params))) + (let ((f (first params))) + (cond ((##core#inline "C_i_nanp" f) + (gen "NAN")) + ((##core#inline "C_i_infinitep" f) + (gen (if (negative? f) "-" "") "INFINITY")) + (else (gen (first params)))))) ((if) (gen #t "if(C_truep(") diff --git a/lfa2.scm b/lfa2.scm index 5d739d9a..3226b2e6 100644 --- a/lfa2.scm +++ b/lfa2.scm @@ -208,7 +208,7 @@ ("C_flonum_greater_or_equal_p" "C_ub_i_flonum_greater_or_equal_p" pred) ("C_flonum_less_or_equal_p" "C_ub_i_flonum_less_or_equal_p" pred) ("C_u_i_flonum_nanp" "C_ub_i_flonum_nanp" pred) - ("C_u_i_flonum_infinitep" "C_ub_i_flonum_infnitep" pred) + ("C_u_i_flonum_infinitep" "C_ub_i_flonum_infinitep" pred) ("C_u_i_flonum_finitepp" "C_ub_i_flonum_finitep" pred) ("C_a_i_flonum_sin" "C_sin" op) ("C_a_i_flonum_cos" "C_cos" op)