Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

Chapter 3 Math.pi exercise – Unkown value Math.pi #68

Closed
ghost opened this issue Feb 25, 2017 · 1 comment
Closed

Chapter 3 Math.pi exercise – Unkown value Math.pi #68

ghost opened this issue Feb 25, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 25, 2017

Chapter 3, exercise 1

“(Easy) Use the Math.pi constant to write a function circleArea which computes the area of a circle with a given radius. Test your function using PSCi (Hint: don’t forget to import pi by modifying the import Math statement).”

In PSCi

> import Math
> Math.pi
Error found:
in module $PSCI
at  line 1, column 1 - line 1, column 6

  Unknown value Math.pi

@soupi helped me out in the IRC channel explaining that I should change my import to either

> import Math as Math
> Math.pi
3.141592653589793

or

> import Math (pi)
> pi
3.141592653589793

I thought this information might be helpful to people attempting the exercises before the subtleties of import are explained

@paf31
Copy link
Owner

paf31 commented Jun 11, 2017

I'll add a note in the book, thanks!

@paf31 paf31 closed this as completed Jun 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant