{"id":71164,"date":"2026-06-04T04:05:25","date_gmt":"2026-06-04T01:05:25","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/"},"modified":"2026-06-04T04:05:25","modified_gmt":"2026-06-04T01:05:25","slug":"flop","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/","title":{"rendered":"Flop"},"content":{"rendered":"<p># Flop | floating point operations for Minecraft<br \/>\nThis datapack is a library for handling floating-point operations using scoreboards. A new data representation, the &#8216;eroxifloat&#8217;, is introduced to support this.<\/p>\n<p>### What is a floating-point number?<br \/>\n<img decoding=\"async\" src=\"https:\/\/media.geeksforgeeks.org\/wp-content\/uploads\/Single-Precision-IEEE-754-Floating-Point-Standard.jpg\"><br \/>\nA floating-point number is a way to represent real numbers in binary. It consists of three parts:<\/p>\n<p>&#8211; Sign: whether the number is positive or negative<br \/>\n&#8211; Exponent: determines the magnitude of the number<br \/>\n&#8211; Mantissa: determines the precision to which numbers can be represented<\/p>\n<p>The numerical value of this representation is:<\/p>\n<p>$$(-1)^text{sign} times text{mantissa} times 2^text{exponent} $$<\/p>\n<p>### The Eroxifloat<br \/>\nAn eroxifloat uses 3 scoreboards to store the sign, exponent and mantissa separately. Functions are provided to convert floating-point numbers in NBT storage to eroxifloats and back again. All math operations are performed on this scoreboard representation, but there are also functions provided that perform all the conversions so that you can simply do math on numbers in NBT storage.<\/p>\n<p>The eroxifloat uses 30 bits to represent the mantissa, making it slightly more precise than a float, but less precise than a double. It is worth to note that the division and square root operations only have 15-bit precision. All other operation preserve 30-bit precision.<\/p>\n<p>The sign can take on the values -1 and 1, rather than 0 and 1 as is the case in regular floating point representations.<\/p>\n<p># How to use<br \/>\nBefore you can use the pack, you need to run the function `flop:api\/create_scoreboards` to set up the required scoreboard objectives and values. This function is not included in the `minecraft:load` tag by default, you need to run it yourself.<\/p>\n<p>Currently, the following six operations are available:<\/p>\n<p>&#8211; Addition ($a + b$)<br \/>\n&#8211; Subtraction ($a &#8211; b$)<br \/>\n&#8211; Multiplication ($a times b$)<br \/>\n&#8211; Division ($frac{a}{b}$)<br \/>\n&#8211; Square ($x^2$)<br \/>\n&#8211; Square root ($sqrt{x}$)<\/p>\n<p>The easiest way to use this library is to make use of the functions in the `flop:api\/storage\/` folder. These perform operations directly on floating-point numbers in NBT storage. For addition, for example:<\/p>\n<p>&#8220;`<br \/>\ndata modify storage flop:api operand.a set value 5d<\/p>\n<p>data modify storage flop:api operand.b set value 0.13d<\/p>\n<p>function flop:api\/storage\/add<\/p>\n<p>data modify <destination> set from storage flop:api output<br \/>\n&#8220;`<\/p>\n<p>Operations that take only one input, such as `sqrt` and `square`, are used as follows:<\/p>\n<p>&#8220;`<br \/>\ndata modify storage flop:api input set value 42.0d<\/p>\n<p>function flop:api\/storage\/sqrt<\/p>\n<p>data modify <destination> set from storage flop:api output<br \/>\n&#8220;`<\/p>\n<p>### Advanced usage<br \/>\nIf you want to calculate complicated formulas, using the operations on storage can cause overhead due to unnecessary conversion between NBT and eroxifloat representations. You can instead perform operations on eroxifloats directly. To create an eroxifloat from a number in NBT storage, use the following function `flop:api\/storage\/read_as_eroxifloat`. This will convert the number stored in `storage flop:api input` into the three scoreboard values `input.sign flop`, `input.exponent flop` and `input.mantissa flop`:<br \/>\n&#8220;`<br \/>\ndata modify storage flop:api input set value 5d<\/p>\n<p>function flop:api\/storage\/read_as_eroxifloat<\/p>\n<p>scoreboard players operation <destination 1> = input.sign flop<br \/>\nscoreboard players operation <destination 2> = input.exponent flop<br \/>\nscoreboard players operation <destination 3> = input.mantissa flop<br \/>\n&#8220;`<\/p>\n<p>You can then perform the same kinds of calculations as before, but without the overhead of converting to NBT.<\/p>\n<p>&#8220;`<br \/>\nscoreboard players operation operand.a.sign flop =<source 1>scoreboard players operation operand.a.exponent flop =<source 2>scoreboard players operation operand.a.mantissa flop =<source 3>scoreboard players operation operand.b.sign flop =<source 4>scoreboard players operation operand.b.exponent flop =<source 5>scoreboard players operation operand.b.mantissa flop =<source 6>function flop:api\/eroxifloat\/add<\/p>\n<p>scoreboard players operation <destination 1> = output.sign flop<br \/>\nscoreboard players operation <destination 2> = output.exponent flop<br \/>\nscoreboard players operation <destination 3> = output.mantissa flop<br \/>\n&#8220;`<\/p>\n<p>&#8220;`<br \/>\nscoreboard players operation input.sign flop =<source 1>scoreboard players operation input.exponent flop =<source 2>scoreboard players operation input.mantissa flop =<source 3>function flop:api\/eroxifloat\/sqrt<\/p>\n<p>scoreboard players operation <destination 1> = output.sign flop<br \/>\nscoreboard players operation <destination 2> = output.exponent flop<br \/>\nscoreboard players operation <destination 3> = output.mantissa flop<br \/>\n&#8220;`<\/p>\n<p>And for converting back to NBT, there are two options: writing as a float or as a double. Since the eroxifloat is slightly more precise than a normal float, the latter is reccomended. However, in some cases you may need your number to be a float instead.<br \/>\n&#8220;`<br \/>\nscoreboard players operation output.sign flop =<source 1>scoreboard players operation output.exponent flop =<source 2>scoreboard players operation output.mantissa flop =<source 3>function flop:api\/eroxifloat\/write_to_float<br \/>\n&#8220;`<br \/>\n&#8220;`<br \/>\nscoreboard players operation output.sign flop =<source 1>scoreboard players operation output.exponent flop =<source 2>scoreboard players operation output.mantissa flop =<source 3>function flop:api\/eroxifloat\/write_to_double<br \/>\n&#8220;`<\/p>\n<p># Final note<br \/>\nThanks for reading \ud83d\ude00<br \/>\n-Eroxen<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Library for floating-point operations using scoreboards<\/p>\n","protected":false},"featured_media":71165,"template":"","meta":{"_minecraft_slug":"flop","_minecraft_project_id":"lrw8bzNb","_minecraft_author":"Eroxen","_minecraft_license":"AGPL-3.0-only","_minecraft_downloads":111,"_minecraft_follows":3,"_minecraft_client_side":"optional","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"flop.zip","_minecraft_size_bytes":125648,"_minecraft_version_count":1,"_minecraft_updated_at":"2026-05-15T22:09:55.180912Z","_minecraft_date_created":"2023-09-27T02:46:30.067611Z","_minecraft_date_modified":"2023-09-26T20:55:24.242023Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/flop","_minecraft_icon_attachment_id":71165,"_minecraft_imported_at":"2026-06-04T01:05:25+00:00","_minecraft_import_hash":"5855a1f0b8e80231367927f9f297d68a","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[84,873],"mod_loader":[86],"minecraft_version":[115,116,117,118,119,120,46,47,48,49,50,51,52,53,54,55,56,57,58,59,36,60],"class_list":["post-71164","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-datapack","mod_category-library","mod_loader-datapack","minecraft_version-1-15","minecraft_version-1-15-1","minecraft_version-1-15-2","minecraft_version-1-16","minecraft_version-1-16-1","minecraft_version-1-16-2","minecraft_version-1-16-3","minecraft_version-1-16-4","minecraft_version-1-16-5","minecraft_version-1-17","minecraft_version-1-17-1","minecraft_version-1-18","minecraft_version-1-18-1","minecraft_version-1-18-2","minecraft_version-1-19","minecraft_version-1-19-1","minecraft_version-1-19-2","minecraft_version-1-19-3","minecraft_version-1-19-4","minecraft_version-1-20","minecraft_version-1-20-1","minecraft_version-1-20-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Flop - Minecraft<\/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:\/\/vpesports.com\/minecraft\/mods\/flop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flop - Minecraft\" \/>\n<meta property=\"og:description\" content=\"Library for floating-point operations using scoreboards\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/flop\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta property=\"og:image\" content=\"https:\/\/media.geeksforgeeks.org\/wp-content\/uploads\/Single-Precision-IEEE-754-Floating-Point-Standard.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/\",\"name\":\"Flop - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp\",\"datePublished\":\"2026-06-04T01:05:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp\",\"width\":96,\"height\":54},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/flop\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Flop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flop - Minecraft","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:\/\/vpesports.com\/minecraft\/mods\/flop\/","og_locale":"en_US","og_type":"article","og_title":"Flop - Minecraft","og_description":"Library for floating-point operations using scoreboards","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/","og_site_name":"Minecraft","og_image":[{"url":"https:\/\/media.geeksforgeeks.org\/wp-content\/uploads\/Single-Precision-IEEE-754-Floating-Point-Standard.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/","name":"Flop - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp","datePublished":"2026-06-04T01:05:25+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/flop\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/flop-icon-c9a13949025eaca29d520cf72b844e3d24952500_96.webp","width":96,"height":54},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/flop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"Flop"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/71164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/71165"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=71164"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=71164"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=71164"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=71164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}