{"id":11588,"date":"2015-12-08T09:15:47","date_gmt":"2015-12-08T17:15:47","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=11588"},"modified":"2015-12-07T16:26:02","modified_gmt":"2015-12-08T00:26:02","slug":"bringing-back-boolean-and-other-data-types","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","title":{"rendered":"Bringing Back Boolean (And Other) Data Types"},"content":{"rendered":"<p>Last year, James Colvin wrote <a href=\"https:\/\/digilent.com\/blog\/index.php\/true-or-false-boolean-is-a-data-type\/\">a guide to understanding the different data types that are commonly used<\/a> by programmers. While he focused specifically on Boolean data, he also talks about others. Since it&#8217;s been a while, we thought it was time to revisit his guide!<\/p>\n<p>&#8220;In a broad sense, data types are ways to represent different kinds of information in a computer processor or FPGA. Today we will be discussing booleans, integers, chars, and floating point numbers, all of which are commonly known as primitive data types,&#8221; said James.<\/p>\n<p>Okay, a quick run-through.<\/p>\n<p>Boolean data is that which represents &#8220;true&#8221; or &#8220;false&#8221; information. This is represented by ones and zeroes.\u00a0A character,or a char, is an array of bits that define the\u00a0visual representation of a symbol. When you see ASCII characters, this is what they are &#8212; the appropriate array of bits.\u00a0Integers, usually shortened to just &#8220;int&#8221; in programming, are the standard way to store numbers within your code. These are whole numbers, so any decimals will be truncated. Finally, there is the floating point data type. A &#8220;float&#8221; accepts up to seven decimal places via a type of scientific notation that uses of 32 bits, eight of which are devoted to the decimals.<\/p>\n<figure id=\"attachment_4246\" aria-describedby=\"caption-attachment-4246\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4246\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-600x77.png\" alt=\"A breakdown of a 32 bit float -- Image from this Wikipedia page by Fresheneesz\" width=\"600\" height=\"77\" data-wp-pid=\"4246\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-600x77.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-225x29.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_.png 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-4246\" class=\"wp-caption-text\">A breakdown of a 32 bit float &#8212; Image from this Wikipedia page by Fresheneesz.<\/figcaption><\/figure>\n<p>All of these data types have their specific uses and applications, it&#8217;s just a matter of deciding which is right for your programming endeavor! For more in-depth informations, see James&#8217; <a href=\"https:\/\/digilent.com\/blog\/index.php\/true-or-false-boolean-is-a-data-type\/\">original post<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-11588 jlk' data-task='like' data-post_id='11588' data-nonce='ce84b66ba5' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-11588 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-11588 jlk' data-task='unlike' data-post_id='11588' data-nonce='ce84b66ba5' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-11588 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-11588 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Learn more about data types!<\/p>\n","protected":false},"author":7,"featured_media":4243,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false,"_ppma_block_editor_authors":""},"categories":[1563],"tags":[],"ppma_author":[4464],"class_list":["post-11588","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bringing Back Boolean (And Other) Data Types - Digilent Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bringing Back Boolean (And Other) Data Types - Digilent Blog\" \/>\n<meta property=\"og:description\" content=\"Learn more about data types!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Digilent Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-08T17:15:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png\" \/>\n\t<meta property=\"og:image:width\" content=\"849\" \/>\n\t<meta property=\"og:image:height\" content=\"566\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Amber Mear\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amber Mear\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/\"},\"author\":{\"name\":\"Amber Mear\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/#\\\/schema\\\/person\\\/c33500b30135cd0853e452b0ccfa2bcb\"},\"headline\":\"Bringing Back Boolean (And Other) Data Types\",\"datePublished\":\"2015-12-08T17:15:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/\"},\"wordCount\":269,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/digilent.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/boolean-true-false.png\",\"articleSection\":[\"How-To Guides and Technical Workflows \u2013 Digilent Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/\",\"url\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/\",\"name\":\"Bringing Back Boolean (And Other) Data Types - Digilent Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/digilent.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/boolean-true-false.png\",\"datePublished\":\"2015-12-08T17:15:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/#\\\/schema\\\/person\\\/c33500b30135cd0853e452b0ccfa2bcb\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#primaryimage\",\"url\":\"https:\\\/\\\/digilent.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/boolean-true-false.png\",\"contentUrl\":\"https:\\\/\\\/digilent.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/12\\\/boolean-true-false.png\",\"width\":849,\"height\":566,\"caption\":\"The two options for a Boolean data type -- Image from jdhitsolutions.com\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/bringing-back-boolean-and-other-data-types\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/digilent.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bringing Back Boolean (And Other) Data Types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/digilent.com\\\/blog\\\/\",\"name\":\"Digilent Blog\",\"description\":\"Learning for Engineers, Students, and Hobbyists\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/digilent.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/digilent.com\\\/blog\\\/#\\\/schema\\\/person\\\/c33500b30135cd0853e452b0ccfa2bcb\",\"name\":\"Amber Mear\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=gfaace292e54f77e65a2a49c9902b2a29\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g\",\"caption\":\"Amber Mear\"},\"description\":\"I was the Digilent blog editor, and now I'm a contributor. I love learning about wearables and writing about social issues in STEM. Outside of work, I can be found watching Netflix with my cat, working on an art project, or trying to find new, delicious local foods.\",\"url\":\"https:\\\/\\\/digilent.com\\\/blog\\\/author\\\/amber_mear\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bringing Back Boolean (And Other) Data Types - Digilent Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","og_locale":"en_US","og_type":"article","og_title":"Bringing Back Boolean (And Other) Data Types - Digilent Blog","og_description":"Learn more about data types!","og_url":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","og_site_name":"Digilent Blog","article_published_time":"2015-12-08T17:15:47+00:00","og_image":[{"width":849,"height":566,"url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","type":"image\/png"}],"author":"Amber Mear","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Amber Mear","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#article","isPartOf":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/"},"author":{"name":"Amber Mear","@id":"https:\/\/digilent.com\/blog\/#\/schema\/person\/c33500b30135cd0853e452b0ccfa2bcb"},"headline":"Bringing Back Boolean (And Other) Data Types","datePublished":"2015-12-08T17:15:47+00:00","mainEntityOfPage":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/"},"wordCount":269,"commentCount":0,"image":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","articleSection":["How-To Guides and Technical Workflows \u2013 Digilent Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","url":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","name":"Bringing Back Boolean (And Other) Data Types - Digilent Blog","isPartOf":{"@id":"https:\/\/digilent.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#primaryimage"},"image":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","datePublished":"2015-12-08T17:15:47+00:00","author":{"@id":"https:\/\/digilent.com\/blog\/#\/schema\/person\/c33500b30135cd0853e452b0ccfa2bcb"},"breadcrumb":{"@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#primaryimage","url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","contentUrl":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","width":849,"height":566,"caption":"The two options for a Boolean data type -- Image from jdhitsolutions.com"},{"@type":"BreadcrumbList","@id":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/digilent.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bringing Back Boolean (And Other) Data Types"}]},{"@type":"WebSite","@id":"https:\/\/digilent.com\/blog\/#website","url":"https:\/\/digilent.com\/blog\/","name":"Digilent Blog","description":"Learning for Engineers, Students, and Hobbyists","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/digilent.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/digilent.com\/blog\/#\/schema\/person\/c33500b30135cd0853e452b0ccfa2bcb","name":"Amber Mear","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=gfaace292e54f77e65a2a49c9902b2a29","url":"https:\/\/secure.gravatar.com\/avatar\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g","caption":"Amber Mear"},"description":"I was the Digilent blog editor, and now I'm a contributor. I love learning about wearables and writing about social issues in STEM. Outside of work, I can be found watching Netflix with my cat, working on an art project, or trying to find new, delicious local foods.","url":"https:\/\/digilent.com\/blog\/author\/amber_mear\/"}]}},"jetpack_sharing_enabled":true,"authors":[{"term_id":4464,"user_id":7,"is_guest":0,"slug":"amber_mear","display_name":"Amber Mear","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Mear","last_name_2":"","first_name":"Amber","first_name_2":"","job_title":"","description":"I was the Digilent blog editor, and now I'm a contributor. I love learning about wearables and writing about social issues in STEM. Outside of work, I can be found watching Netflix with my cat, working on an art project, or trying to find new, delicious local foods."}],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/boolean-true-false.png","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/11588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=11588"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/11588\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/4243"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=11588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=11588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=11588"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=11588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}