Tried to get more sensible printing of floating point numbers

Results are quite disappointing. Resolution on long doubles is nothing like as good as I hoped; they're out by one part in 10^20.

All unit tests except one pass, and the one that doesn't is a very minor rounding issue, so I'm calling it good.
This commit is contained in:
Simon Brooke 2018-12-08 00:28:15 +00:00
parent fc960dec20
commit 27fd678888
9 changed files with 45 additions and 14 deletions

View file

@ -73,7 +73,6 @@ int main( int argc, char *argv[] ) {
*/
deep_bind( c_string_to_lisp_symbol( "nil" ), NIL );
deep_bind( c_string_to_lisp_symbol( "t" ), TRUE );
/* deep_bind( c_string_to_lisp_symbol( L"λ"), LAMBDA ); */
deep_bind( c_string_to_lisp_symbol( "lambda" ), LAMBDA );
/*
@ -85,6 +84,7 @@ int main( int argc, char *argv[] ) {
bind_function( "car", &lisp_car );
bind_function( "cdr", &lisp_cdr );
bind_function( "cons", &lisp_cons );
bind_function( "divide", &lisp_divide );
bind_function( "eq", &lisp_eq );
bind_function( "equal", &lisp_equal );
bind_function( "eval", &lisp_eval );
@ -98,6 +98,7 @@ int main( int argc, char *argv[] ) {
bind_function( "+", &lisp_add );
bind_function( "*", &lisp_multiply );
bind_function( "-", &lisp_subtract );
bind_function( "/", &lisp_divide );
/*
* primitive special forms