Skip to content

Converts a floating-point number or hexadecimal representation of a floating-point numbers into various formats and displays them into binary/hexadecimal.

License

Notifications You must be signed in to change notification settings

ojy0216/floatConversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Floating point number Converter

C implementation of converting floating point number into various formats(FP16, FP32, FP64, bfloat16) and displays into binary, hexadecimal format.

Features

  • Floating points conversion to FP16, FP32, FP64, BF16
  • Displays sign, exponent, mantissa bits
  • Displays hexadecimal representation of floating points
  • Displays converted exact floating point value
  • Input can be floating point number or hexadecimal representation of floating point number()

Usage

Include "fConvert.h" header and compile with "fConvert.c" file

#include "fConvert.h"

Function convert() gets double(FP64) inputs and displays conversion results.

convert(3.141592654);

Example(main.c)

  1. Floating point input
./main 3.141592654

fig1

  1. Hexadecimal input(w/ -h, -s, -d, -b option)
./main 402df84d -s 

fig2

About

Converts a floating-point number or hexadecimal representation of a floating-point numbers into various formats and displays them into binary/hexadecimal.

Topics

Resources

License

Stars

Watchers

Forks