Erlang – binary_to_float

Erlang binary_to_float

In this guide, we will discuss Erlang binary_to_float. This method is used to convert a binary value to a float value.

Syntax

binary_to_float(binaryvalue)

Parameters

  • binaryvalue − this is binary value which needs to be converted to a float value.

Return Value

Returns the float value from the binary value.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[binary_to_float(<<"2.2">>)]).

Output

When we run the above program we will get the following result.

2.2

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply