Arithmetic equality fixed.

This commit is contained in:
Simon Brooke 2026-02-15 13:30:27 +00:00
parent b97401bfde
commit d7e0220674
6 changed files with 117 additions and 27 deletions

View file

@ -748,3 +748,29 @@ struct cons_pointer lisp_divide( struct
return result;
}
/**
* @brief Function: return a real (approcimately) equal in value to the ratio
* which is the first argument.
*
* @param frame
* @param frame_pointer
* @param env
* @return struct cons_pointer a pointer to a real
*/
// struct cons_pointer lisp_eval( struct stack_frame *frame, struct cons_pointer frame_pointer,
// struct cons_pointer env )
struct cons_pointer lisp_ratio_to_real( struct stack_frame *frame, struct cons_pointer frame_pointer,
struct cons_pointer env) {
struct cons_pointer result = NIL;
struct cons_pointer rat = frame->arg[0];
debug_print( L"\nc_ratio_to_ld: ", DEBUG_ARITH);
debug_print_object( rat, DEBUG_ARITH);
if ( ratiop( rat)) {
result = make_real( c_ratio_to_ld( rat));
} // TODO: else throw an exception?
return result;
}