#!/usr/bin/env python # # file: /lectures/lecture_12/example.py # # revision history: # # 20260209 (JP): initial version #------------------------------------------------------------------------------ # import system modules # import numpy as np import os import sys import time # import other modules # #------------------------------------------------------------------------------ # # global variables are listed here # #------------------------------------------------------------------------------ # set the filename using basename # __FILE__ = os.path.basename(__file__) #------------------------------------------------------------------------------ # # functions are listed here # #------------------------------------------------------------------------------ # function: main # def main(argv): # declare a float - is this a double? # x = 27.2727272727 print("double precision: ", x) y = np.float32(27.2727272727) print("single precision: ", y) # Signed 16-bit integer x = np.int16(32769) print("16-bit integer: ", x) # Unsigned 16-bit integer y = np.uint16(32768) print("16-bit unsigned integer: ", y) # exit gracefully # return # # end of main # begin gracefully # if __name__ == "__main__": main(sys.argv[0:]) # # end of file