In fact, calculators have the same floating point limitations as computers, which makes sense, because calculators are simple computers. Try adding 0.1 to 1,000,000,000 and you'll get 1,000,000,000, not 1,000,000,000.1 (unless your calculator uses 64-bit numbers, which can precisely display up to about 18 digits); or try cos(0.00001) and you'll get 1, not 0.99999999995. They seem to be more accurate because they can limit their outputs. It's worth noting that having a hardware FPU does not guarantee greater precision than using a floating point library, as Arduinos do. The highest precision operations are actually done in software. Take a look at Java's BigDecimal for a great example and explanation.
You are correct in thinking that there could be a loss of precision when working with base-10 numbers in a binary system. The IEEE 754 standard defines 5 binary and 3 decimal floating point formats, where the latter can store decimal numbers exactly. Since the libm.a floating point library (Arduino/avr-gcc, etc.) likely uses the "binary32" format, it does not represent decimal number exactly, and is accurate to about 7 digits. Any format is no more precise than the value of the least significant bit ("LSB") (big-endian only; MSB value for little-endien) in the significand. For binary32 numbers, this is 2^-23 times the exponent, which is related to its magnitude. A quick search found a library that may be able to introduce the decimal32/64/128 formats to an Arduino platform, [here]: GitHub.com/toddtreece/esp8266-Arduino/.../decimal (it is for the ESP8266, a 32-bit Xtensa system, however, so it wouldn't work out of the box, if at all, on the 8-bit AVR/etc. systems we are using).
Tyler,
This is a great write up, good explanation and documentation. Thank you. If I have time I’m going to refactor this into my project. I just spent the last while programming the basics of dead reckoning for a two-wheeled, differential steering rover and of course the core of it involved the use of sine and cosine and lots of floats. I’ve read several articles admonishing the use of floats on micro controllers. It’s understandable as you’ve noted due to their limited memory, processing power, and lack of floating point unit. I plowed ahead anyway and with no noticeable performance problems yet. The encoder interrupts are firing about 750/s and I’m calculating coordinates and orientation 10/s. My only concern would be sacrificing precision. Dead-reckoning is known for error accumulation anyway.
Glad you could use it!
You can add another factor of ten or two to increase precision. (The above code is the float output multiplied by 1000.) Would just need to be a bit more careful about overflow when doing math with the output, especially multiplication. E.g. 'sinx' output may be as high as +10000, so don't multiply by more than 32 if using int, ~200000 if using long. Really, manually keeping track of these ranges is a pain in the ass, especially when debugging it (without a debugger/JTAG/etc), so if your application works with floats, I'd just use them... until it doesn't work. :)
Also, IntegerGeometry.h and IntegerGeometry.cpp were promoted to the master branch after a bit more review.
I tried Firefox 57 and the experience for me was the exact opposite. Typical of a corporation programming elite controlling the world. Non of my past extensions worked (0 backward compatibility), the speed did not improve, and I lost access to my Adobe Acrobat XI plugin. But hey great advertising by Mozilla, and trying to stop the automatic updating was a displeasure, in particular updating plugins in FF 56.02 seemed to auto-update the entire web browser. Fortunately I have backups, otherwise I would be forced to buy a whole new computer system just to use Firefox 57 on my 7 year old MAC.
PS. The only positive was that Google docs worked better in FF 57; I am glad someone else had a better experience, but I will be frozen at FF 56.02 and use Chrome/Safari for Google docs...
Thanks for bringin up the topic Jon. Signal is "almost there" when it comes privacy and security. The Briar project aims to solve that problem by implementing a fully descentralized system. A security audit report of its implementation and code was released not too long ago. Unfortunately the iOS implementation is still a work in progress.
great article Steve: 365 office decision done by somebody who is not working at AU anymore -- no idea why following ideas those who gone with the wind.... -- elenar
- an-nonsense
Thanks Elenar for your thoughts,
You have touched on a subject that I have witnessed in education for many iterations since becoming a student in post-secondary, that is pushing technologies on the client without understanding what the client wanted. ...and worse is that you, I, and everyone else are paying for it. Yahoo!
I was not excited, this is the 21st century, real Internet users already have there own email address, don't need what I did not ask for.
The activity pages show you all the posts that you are allowed to see on the site. This is sometimes referred to as the activity stream or river. It is a great way to keep up to date with what has been posted on the site. You can configure the river to show things that particularly interest you - in your settings you can configure activity tabs to display activities from people in specific groups and your circles.
We welcome comments on public posts from members of the public. Please note, however, that all comments made on public posts must be moderated by their owners before they become visible on the site. The owner of the post (and no one else) has to do that.
If you want the full range of features and you have a login ID, log in using the links at the top of the page or at https://landing.athabascau.ca/login (logins are secure and encrypted)
Posts made here are the responsibility of their owners and may not reflect the views of Athabasca University.