It's UWAweek 50

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 2 articles in this topic
Showing 2 of 835 articles.
Currently 14 other people reading this forum.


 UWA week 30 (2nd semester, week 1) ↓
SVG not supported

Login to reply

👍?
helpful
4:03pm Wed 24th Jul, Christopher M.

In today's lecture we saw why real-valued (floating-point) numbers are used very rarely, if at all, in systems programming and operating systems kernels. Here's an article describing the problem, Stop Using Floating-Point Numbers to Store Money https://spin.atomicobject.com/floating-point-numbers/ and another going into several pages of detail: What Every Programmer Should Know About Floating-Point Arithmetic https://floating-point-gui.de


 UWA week 32 (2nd semester, week 3) ↓
SVG not supported

Login to reply

👍?
helpful
5:04pm Thu 8th Aug, Christopher M.

A student recently emailed me with this related question. Thought the answer may also interest others. ___ Hi Dr.McDonald, I got a question out of interest inspired by a lab question. We know that calculating the floating number is inaccurate in computer. I was thinking how the computing software works like Mathematica, which is wildly used in computing area and its really powerful. I also known Mathematica is written in C and Java. So, how do we solve this kind of problem caused by floating numbers. ___ There's a number of libraries, and programming languages, that support what's termed multi-precision arithmetic, or arbitrary precision arithmetic, supporting both 'infinitely large' integers, and floating-point values with an 'unlimited' number of decimal places. Often these libraries will recognise standard values, such as e, sqrt(2), and 1 / pi as exact values, and perform their arithmetic using symbolic computation, where they can, rather than converting the values to imprecise approximations. Here's a good list: https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software Here's an example of using the standard bc utility to calculate the first 1000 digits of pi: time bc -l <<< "scale=1000;4*a(1)" Hope this helps,

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy