পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Tuesday, January 31, 2017

Erlang - Binaries

Use a data structure called a binary to store large quantities of raw data. Binaries store data in a much more space efficient manner than in lists or tuples, and the runtime system is optimized for the efficient input and output of binaries.

Binaries are written and printed as sequences of integers or strings, enclosed in double less than and greater than brackets.
Following is an example of binaries in Erlang −

Example

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

start() -> 
   io:fwrite("~p~n",[<<5,10,20>>]), 
   io:fwrite("~p~n",[<<"hello">>]).
When we run the above program, we will get the following result.

Output

<<5,10,20>>
<<"hello">>
Let’s look at the Erlang functions which are available to work with Binaries −
S.No Methods & Description
1 list_to_binary This method is used to convert an existing list to a list of binaries.
2 split_binary This method is used to split the binary list based on the index position specified.
3 term_to_binary This method is used to convert a term to binary.
4 is_binary This method is used to check if a bitstring is indeed a binary value.
5 binary_part This method is used to extract a part of the binary string
6 binary_to_float This method is used to convert a binary value to a float value.
7 binary_to_integer This method is used to convert a binary value to a integer value.
8 binary_to_list This method is used to convert a binary value to a list.
9 binary_to_atom This method is used to convert a binary value to an atom.

No comments:

Post a Comment