Monday, January 2, 2012

[IFP] Exercises 1.5

Unsure about these two... they seemed simple, which quite often means they weren't....
1.5.1 Using any suitable notation, write a specification of a function isSquare that determines whether or not its argument is an integer which is the square of another integer.
isSquare x == (squareRoot x)^(.5), for all x >= 0
1.5.2 Write down a precise specification of the function insqrt mentioned in the previous question.
intsqrt is the largest possible integer < sqrt(x)

No comments:

Post a Comment