O'Reilly logo

Mathematics and Physics for Programmers, Second Edition by Danny Kodicek, John Patrick Flynt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix E. Answers to Exercises

There isn’t space in this book to provide code listings for all exercises. The answers provided here are more along the lines of hints and suggestions, with some brief code snippets.

Code samples for the chapters in the book are available on the book’s companion website at www.coursePTR.com/downloads. Examples are provided, implemented in Lingo.

Exercise 1.1 To construct the convertBase(NumberString, Basel, Base2) function, the easiest way to do this (although not the most efficient) is to create one function that converts the string from base 1 to a number, and then another that converts it from a number into base 2. You can use the functions in the text for this, but look at base() and fromBase() in floats.

Exercise ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required