Notes on problem 4.8
- The inexact->exact function can be used to convert from a floating point data type to an integer. This is really useful for the sci-exponent function in 4.8.
- Write sci-exponent first. Then write sci-coefficient. Then write scientific.
- sci-exponent involves something called change of base. If you have not done this using logarithms in a math class (or if you have forgotten how), please see the teacher for help. For those who just need a friendly reminder:
- log10(n) = logb(n)/logb(10)
- In Scheme, the natural log function, ln, not ln, but rather log. In other words, (log 29) in Scheme is ln(29) in your math class.
- So, if you want to compute log10(29), it is equal to logb(29)/logb(10)