#Value in the textbook for 0xFF is wrong
ch = "0xFF"
x = "0xFFFF"
y = "0xFFFF"
print "The decimal of signed 0xFF is ", int(ch, 16)
print "The decimal of signed 0xFFFF is ", int(x, 16)
print "The decimal of unsigned 0xFFFF is ", int(y, 16)
print "The hex of decimal 12345 is 0x%x" %(12345)
#answer in textbook for -12345 is wrong
print "The hex of decimal -12345 is 0x%x" %(-12345)
import sys
print "The size of short int is:",sys.getsizeof(65535)
print "The size of long int is:",sys.getsizeof(65535*65535)
print "The size of float is:",sys.getsizeof(0.0)
# As python has no datatype like double, so that portion of program has not writeen here.
import array
x=0xFFFF
y=0xFFFF
s=0xFFFFFFFFl
t=0xFFFFFFFFL
print "The short int of 0xFFFF is {:d}".format(x)
print "The unsigned int of 0xFFFF is {:d}".format(y)
print "The long int of 0xFFFFFFFFl is {:d}".format(s)
print "The long int of 0xFFFFFFFFl is {:d}".format(t)
import math
x=45.0
x=x*3.141593/180.0
print "The sine of 45 is: ",math.asin(x)
print "The sine of 45 is: ",math.acos(x)
print "The tangent of 45 is: ",math.atan(x)
import math
x=64.0
y=3.0
z=0.5
print "pow(64.0,3.0) returns {:7.0f}".format(math.pow(x,y))
print "sqrt(64.0) returns {:2.0f}".format(math.sqrt(x))
print "pow(64.0,0.5) returns {:2.0f}".format(math.pow(x,z))