[Nickle]A usable calculator again
Barton C Massey
bart@cs.pdx.edu
Wed, 28 Feb 2001 01:52:21 -0800
Nice job!
I've checked in the autoconf etc. changes to get nickle to
load DATADIR/nickle/builtin.5c by default. Note that this
means that running nickle out of the source directory will
load the library from the standard place rather than out of
the source directory: this is arguable, but the alternative
is a giant pain to implement given the current setup.
I import the math namespace in builtin.5c: if this isn't
what people want, we should talk. (It's what *I* want,
anyway.)
I'll try to update the examples RSN to accomodate various
changes (notably Keith's new .5c extension :-).
Keith: sin(0) seems to infinite-loop for me. Also,
shouldn't sin(pi) and friends be 0 given the default
precisions of sin() and pi?
I've seen the convention around (and like it) that says that
log == log_base_10, lg == log_base_2, ln == log_base_e. The
downside is that C math library users will get horribly
surprised. Perhaps log10(), lg(), ln(), and make log() take
two arguments (base + target)? Then C users would get
whined at... Or is everybody happy with log == log_base_e?
Bart
In message <20010228083105.51B81DF801@orestes.keithp.com> you wrote:
>
> With much typing, I've replaced the old machine-specific floating point
> code with arbitrary precision stuff; this is useful, but it temporarily
> reduced the utility of nickle as a calculator -- the C math library can no
> longer be used.
>
> So I wrote an arbitrary precision math library in nickle itself; with
> Bart's code to load a startup file when nickle launches, we'll be back to
> where we were a week ago, except that there are still a lot of functions to
> implement.
>
> I've got sqrt, cbrt, exp, log, log10, sin, cos, sin_cos, tan, arcsin,
> arccos, arctan and arctan2. I'll have to do a bit of work to get the '^'
> operator to use the nickle library code, but I think that's worth the
> effort rather than recoding exp/log in C.
>
> -keith
>
>
>
>
> _______________________________________________
> Nickle mailing list
> Nickle@keithp.com
> http://keithp.com/mailman/listinfo/nickle