Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Hi everyone!

As a developer with a strong passion for gravity simulators, I often find myself in trouble due to the limited precision that languages such as C# offer. If you are a Unity developer, you probably know that most of Unity's back-end uses float variables, which have very limited precision.

This can be particularly tricky if you are trying to create an open-world or racing game. The further you travel from the origin, the messier stuff gets.

For this reason, I started a two-part series that introduced floating-point arithmetic, and shows how to improve its precision. The first post is already available:

In the second part, I explain how to create an even more precise floating-point type, which you can use for simulations. While not perfect, it is a good compromise compared to much slower C# libraries. You can download the library here.

I am more than happy to hear your thoughts on this, especially if you have any other ideas on how to improve the precision of real numbers in your games!

πŸ§”πŸ»

Files

Previews only

An Introduction to Floating-Point Arithmetic - Alan Zucconi

This tutorial will introduce you to floating-point arithmetic, and how many modern languages-C# included-represent real numbers. This is a series in two parts: At the end of this article, you will find a link to download a simple C# library that provides a new type which improves the precision of traditional and variables.

Comments

No comments found for this post.