Pascal: Working with fractures

I was really disappointed of the lack of information about Pascal. I know that it is not very popular language now and there are many better languages around us. However, I do believe that many people need information and examples of Pascal tasks. Moreover, there are still some schools where students learn this language as their first programming experience.

Today I will try to introduce you with some fractures and how to divide them properly in Pascal.So the main point is to add some fractures and then get integer part and a new adjusted fracture.

We will try to write a procedure which will add to fractures.

The second procedure which will we use is going to get the integer part of whole number and make nominator and denominator as small as we can get.

In this example we are using and algorithm to find the greatest common divider which code you can found at my last entry on this blog.

And now we just need to make everything to one working and quite useful Pascal program which code you can see here or download from here.

, ,

About Richard Smaizys

I am a freelance PHP developer working mostly on projects using PrestaShop for ecommerce (modules, theme integration, projects from 0 etc.) and WordPress as CMS solution.
No comments yet.

Leave a Reply