RU beehive logo ITEC dept promo banner
ITEC 109
2014spring
ibarland

homeinfolectslabsexamshws
D2Lbreeze (snow day)tutor/PIs

lab02-function-call
Calling a function
abs, ord, pickAFile


calling functions

The last example — the square root of two — illustrates one more type of data that python has: “floating point numbers”, which is a number with a decimal-point2. They commonly called “float”s or “double”s3.

Updated list: In Python, we have several types of values:


1 If you're a math whiz, you might realize that square-root is actually just a special-case of raising-to-a-power; you could compute the square-root of 2 just by using pow! So there are actually two ways to ask for the square-root of 2. Can you discover even more, perhaps using (say) cos?      

2 It turns out, inside the computer the decimal-point can “float around”, hence the name.      

3 “double” is short for “double-precision floating-point”. But these days, single-precision floating-points are hardly ever used, which is why “double” has become a synonym for floating-point numbers.      

homeinfolectslabsexamshws
D2Lbreeze (snow day)tutor/PIs


©2013, Ian Barland, Radford University
Last modified 2014.Jan.27 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme