{"id":77646,"date":"2022-11-29T09:02:47","date_gmt":"2022-11-29T08:02:47","guid":{"rendered":"https:\/\/drafts.code-maze.com\/?p=77646"},"modified":"2022-11-29T09:02:47","modified_gmt":"2022-11-29T08:02:47","slug":"csharp-floating-point-types","status":"publish","type":"post","link":"https:\/\/code-maze.com\/csharp-floating-point-types\/","title":{"rendered":"Floating-Point Types in C# &#8211; Double vs Float vs Decimal"},"content":{"rendered":"<p>In this article, we are going to cover floating-point types in C#. Our focus will be mainly on <code>Double<\/code>, <code>Float<\/code> and <code>Decimal<\/code> data types. We have covered the basic data types extensively, and you can check out this <a href=\"https:\/\/code-maze.com\/csharp-data-types-variables\/\" target=\"_blank\" rel=\"noopener\">article<\/a> if you feel the need to brush up on the basics.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/numbers-csharp\/FloatingPointTypes\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s start.<\/p>\n<h2>What Are Floating-Point Types in C#?<\/h2>\n<p>These are data types that we use to represent values with decimal points. In a real-world application, we use this data type for cases where we want an extra level of accuracy when dealing with numbers. The most common use cases are:\u00a0<\/p>\n<ul>\n<li>Recording measurements<\/li>\n<li>Recording amounts of money<\/li>\n<\/ul>\n<p>We will use a simple console project to discuss the three floating point types in C#. For that, we can scaffold a new console application in Visual Studio.\u00a0<\/p>\n<p>After creating the project, let&#8217;s define a new <code>FloatingPointArithmetic<\/code> class, which we will use in the coming sections of the article.<\/p>\n<h3>Float<\/h3>\n<p>The <code>float<\/code> data type belongs to the <code>System.Single<\/code> .NET struct. We use it to represent both positive and negative values, with a precision of up to 7 digits. This means that we can store relatively large values in memory during the application lifecycle.\u00a0<\/p>\n<p>When declaring float variables, we attach the suffix <code>F<\/code> or <code>f<\/code> to the value:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">float area =  14.5F;<\/code><\/p>\n<p>or<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">float length = 20.5f;<\/code><\/p>\n<p>When using <code>float<\/code> in our applications, we can perform all numeric computations on our variables. However, due to rounding off, we get inaccurate results from these computations.<\/p>\n<p>Let&#8217;s demonstrate this accuracy when working with floating point numbers:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public bool FloatSumAndMultiplication(float firstValue, float secondValue, int factor)\r\n{\r\n    float sum = 0F;\r\n\r\n    for (var i = 0; i &lt; factor; i++)\r\n    {\r\n        sum += firstValue + secondValue;\r\n    }\r\n\r\n    float product = (firstValue + secondValue) * factor;\r\n\r\n    return sum == product;\r\n}<\/pre>\n<p>We define the <code>FloatSumAndMultiplication<\/code> method, which takes two float values and one integer. To get the sum of the values, we add the values based on the <code>factor<\/code>. For instance, if the factor is 2, we add the values twice. To get the product of the values, we add the values and multiply by the <code>factor<\/code>.\u00a0<\/p>\n<p>Calling this method:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">floatingArithmetic.FloatSumAndMultiplication(0.1f, 0.5f, 10);<\/code><\/p>\n<p>We would expect that <code>sum<\/code> and <code>product<\/code> are equal. However, by printing both values, we get:\u00a0<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">Sum: 5.9999995\r\nProduct: 6<\/pre>\n<p>For <code>sum<\/code>, we loop nine times performing the same computation, while <code>product<\/code> we only do the computation once. We get different results because looping gives us less precise results when working with <code>float<\/code>.<\/p>\n<h3>Double<\/h3>\n<p>The <code>double<\/code> data type belongs to the <code>System.Double<\/code> .NET struct. We use the <code>double<\/code> type to represent values with up 15 digits of precision. Simply put, with higher precision, we can represent more information using the <code>double<\/code> data type. In memory, we reserve 64 bits when we use this data type.\u00a0<\/p>\n<p>When declaring variables of double type, we add a suffix <code>D<\/code> or <code>d<\/code> to the value:\u00a0<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">double length = 4.5D;<\/code><\/p>\n<p>or<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">double total = 20.3d;<\/code><\/p>\n<p>Similar to <code>float<\/code>, the results we get when we perform numeric calculations using the <code>double<\/code> type lack accuracy, because of rounding off errors.<\/p>\n<p>Let&#8217;s demonstrate using double in mathematical computations:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public bool DoubleSumAndMultiplication(double firstValue, double secondValue, int factor)\r\n{\r\n    double sum = 0D;\r\n\r\n    for (var i = 0; i &lt; factor; i++)\r\n    {\r\n        sum += firstValue + secondValue;\r\n    }\r\n\r\n    double product = (firstValue + secondValue) * factor;\r\n\r\n    return sum == product;\r\n}<\/pre>\n<p>Here we define the <code>DoubleSumAndMultiplication<\/code> method, which returns either <code>true<\/code> or <code>false<\/code> depending on whether the values of <code>sum<\/code> and <code>product<\/code> are equal.<\/p>\n<p>Calling the method:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">floatingArithmetic.DoubleSumAndMultiplication(0.2D, 1.5D, 10);<\/code><\/p>\n<p>We expect <code>sum<\/code> and <code>product<\/code> to be equal, but printing results to the console, we get:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">Sum: 16.999999999999996\r\nProduct: 17<\/pre>\n<h3>Decimal<\/h3>\n<p>The <code>decimal<\/code> data type belongs to the <code>System.Decimal<\/code> .NET struct. We use this data type in cases where we need a lot more accuracy with our data. <code>Decimal<\/code> type occupies 128 bits in memory, which is twice that occupied by <code>double<\/code>. Also, it has the highest precision of the three floating point types.<\/p>\n<p>We declare a decimal type by adding the suffix <code>M<\/code> or <code>m<\/code> to the value:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">decimal value = 1.5M<\/code><\/p>\n<p>or<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">decimal value1 = 2.5m<\/code><\/p>\n<p>When we use <code>decimal<\/code> in calculations, we get more accurate results as opposed to <code>double<\/code> and <code>float<\/code> that have rounding-off errors. In this case, <code>decimal<\/code> could come in handy when doing financial computations.<\/p>\n<p>Let&#8217;s look at decimal computations:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public bool DecimalSumAndMultiplication(decimal firstValue, decimal secondValue, int factor)\r\n{\r\n    decimal sum = 0M;\r\n\r\n    for (var i = 0; i &lt; factor; i++)\r\n    {\r\n        sum += firstValue + secondValue;\r\n    }\r\n\r\n    decimal product = (firstValue + secondValue) * factor;\r\n\r\n    return sum == product;\r\n}<\/pre>\n<p>We pass two decimal parameters and one integer to the <code>DecimalSumAndMultiplication<\/code> method. Then, we calculate the sum and product of the values. Based on the result of comparing the two values, we return either <code>true<\/code> or <code>false<\/code>.<\/p>\n<p>When we call the method:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">floatingArithmetic.DecimalSumAndMultiplication(0.2M, 1.5M, 10);<\/code><\/p>\n<p>We expect that both <code>sum<\/code> and <code>product<\/code> are equal.<\/p>\n<p>Examining the results of the method call, we get:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">Sum: 17.0\r\nProduct: 17.0<\/pre>\n<p>Both sum and product values are equal, and the method returns <code>true<\/code>. Compared to <code>float<\/code> and <code>double<\/code>, the <code>decimal<\/code> type is the most accurate and most precise.<\/p>\n<h2>Use Cases of Floating-Point Types<\/h2>\n<p>Having learned about the different types, when should we choose one data type over another?\u00a0<\/p>\n<p>The precision of our results is an important factor. In cases where we want to minimize errors, <code>decimal<\/code> would be a perfect choice. In cases where precision is not the first priority, then either double or float is a choice.<\/p>\n<p>When we want to store large values, depending on the size, we would choose between the three types. <code>Float<\/code> stores the smallest values, followed by <code>double<\/code> then <code>decimal<\/code>. However, the larger values have slower execution speeds compared to <code>float<\/code>.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article, we have covered floating-point types in C#. Handling data in our applications can be quite challenging at first and could impact how our applications perform. With this newly acquired knowledge, we can confidently work with numeric data and improve the quality of our applications.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to cover floating-point types in C#. Our focus will be mainly on Double, Float and Decimal data types. We have covered the basic data types extensively, and you can check out this article if you feel the need to brush up on the basics. Let&#8217;s start. What Are Floating-Point [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12],"tags":[1519,1000,1518,1517,972],"class_list":["post-77646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","tag-decimal","tag-double","tag-float","tag-floating-point-types","tag-numbers","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Floating-Point Types in C# - Double vs Float vs Decimal<\/title>\n<meta name=\"description\" content=\"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/csharp-floating-point-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Floating-Point Types in C# - Double vs Float vs Decimal\" \/>\n<meta property=\"og:description\" content=\"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/csharp-floating-point-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-29T08:02:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Floating-Point Types in C# &#8211; Double vs Float vs Decimal\",\"datePublished\":\"2022-11-29T08:02:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/\"},\"wordCount\":810,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"decimal\",\"double\",\"float\",\"floating point types\",\"Numbers\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/csharp-floating-point-types\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/\",\"url\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/\",\"name\":\"Floating-Point Types in C# - Double vs Float vs Decimal\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2022-11-29T08:02:47+00:00\",\"description\":\"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/csharp-floating-point-types\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/csharp-floating-point-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Floating-Point Types in C# &#8211; Double vs Float vs Decimal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Floating-Point Types in C# - Double vs Float vs Decimal","description":"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.","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:\/\/code-maze.com\/csharp-floating-point-types\/","og_locale":"en_US","og_type":"article","og_title":"Floating-Point Types in C# - Double vs Float vs Decimal","og_description":"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.","og_url":"https:\/\/code-maze.com\/csharp-floating-point-types\/","og_site_name":"Code Maze","article_published_time":"2022-11-29T08:02:47+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Floating-Point Types in C# &#8211; Double vs Float vs Decimal","datePublished":"2022-11-29T08:02:47+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/"},"wordCount":810,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["decimal","double","float","floating point types","Numbers"],"articleSection":["C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/csharp-floating-point-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/","url":"https:\/\/code-maze.com\/csharp-floating-point-types\/","name":"Floating-Point Types in C# - Double vs Float vs Decimal","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2022-11-29T08:02:47+00:00","description":"An introduction to floating-point types in C#. We shall cover the different floating point types and do a comparison among them.","breadcrumb":{"@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/csharp-floating-point-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/csharp-floating-point-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Floating-Point Types in C# &#8211; Double vs Float vs Decimal"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/77646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=77646"}],"version-history":[{"count":2,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/77646\/revisions"}],"predecessor-version":[{"id":77647,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/77646\/revisions\/77647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=77646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=77646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=77646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}