This product is no longer in stock
To perform addition and subtraction of fractions in Visual Basic NET, we need to create a structure that allows us to handle them, this is because the language does not give us native support for rational numbers.
In this case, implement a structure that I called NumeroRacional which consists of the following:
It's simple enough to use.
To create a rational number:
You can also create fractions from
Dim Fraccion As NumeroRacional
Dim Fraccion As New NumeroRacional("1/2")
Dim Fraccion As New NumeroRacional(0.5)
Give individual parameters directly
Dim Fraccion As New NumeroRacional(1,2)
The structure also has the usual arithmetic operators implemented, so it can easily add two fractions directly in the code to be readable.
Dim Fraccion1, Fraccion2, resultado As NumeroRacional
Fraccion1 = New NumeroRacional("1/2")
Fraccion2 = New NumeroRacional("1/4")
resultado = Fraccion1 + Fraccion2
As you can see, performing the arithmetic operations with the structure is very simple.
Fractions is a small program that performs arithmetic operations with n fractions. Written in a simple way, without much error handling so that the reader can focus on how the NumeroRacional structure works.
Totally free of viruses and malicious software, so do not wait any longer to download it now.
Do not forget to give us an opinion about the program, to improve the content.
NO registration required!
If the question you have has not yet been answered here, use the form below to ask something about this addon.