English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang Binary binary_to_float Method

Binary Files in Erlang

This method is used to convert binary values to floating-point values.

Syntax

binary_to_float(binaryvalue)

Parameter

  • binaryvalue −This is a binary value, which needs to be converted to a floating-point value.

Return Value

Return Floating Point Value from Binary Value

-module(helloworld). 
-export([start/0]). 
start() -> 
   io:fwrite("~p~n",[binary_to_float(<<"2.2">>)]).

When we run the above program, we will get the following results.

2.2

Binary Files in Erlang