Chapter 8 exercise.
Use union for lval num and err members.