Skip to content

This program implements two functions for converting between IEEE single precision floating-point and 32-bit two's complement integers

Notifications You must be signed in to change notification settings

jhadkaterji/IntegerToFloat-FloatToInteger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

IntegerToFloat-FloatToInteger

This program implements two functions for converting between IEEE single precision floating-point and 32-bit two's complement integers

Requirements: The i2f routine should take one 32-bit integer as its only argument and should return a 32-bit integer. However, the return value should be interpreted to be actually an IEEE single-precision floating-point value. The return value should be the result of converting the input integer value to IEEE single-precision floating point. The conversion should be implemented using only integer operations. Be sure to handle negative input values.

The f2i routine should take one 32-bit integer as its only argument and should return a 32-bit integer. However, the input value should be interpreted to be actually an IEEE single-precision floating-point value. The return value should be the result of converting the input value to 32-bit two's complement integer. The conversion should be implemented using only integer operations. Be sure to handle negative, NaN, infinity and denormalized input floating-point values.

About

This program implements two functions for converting between IEEE single precision floating-point and 32-bit two's complement integers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages