Home » Developing U++ » UppHub » New STEM4U package
New STEM4U package [message #53091] |
Tue, 25 February 2020 08:11  |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
Science, technology, engineering, and mathematics involve a huge need of computing.
New Bazaar package STEM4U includes libraries focused to make life easier for those who want to make a better world through science and technology.
From now it begins with a few libraries. However more will be added in the future. You all are invited to support it being part of the authors' list.
One example of library included is Rational, an arbitrary precision rational number
We use computers for doing floating point calculations. However even using 64 bit types, lack of precision in calculations produce inaccuracies that go accumulating over time, thus increasing the error.
For example, lets compute y = 2/1 * 3/2 * 4/3 * ... If done n times, result has to be n.
However, the code implementing this will fail:
double val = 1;
for (double d = 1; d < 100; ++d)
val *= (d+1)/d;
Cout() << "double == 100: " << ((dval == 100) ? "true" : "false") << "\n"; // It returns false!?!?
Rational class solves this drawback implementing an arbitrary precision integer rational number.
Best regards
Iñaki
|
|
|
Re: New STEM4U package [message #54402 is a reply to message #53091] |
Sun, 12 July 2020 16:48   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Now STEM4U includes some financial functions:
- NetPresentValue()
- InternalRateOfReturn()
- PMT() (periodic payment for a loan)
Because successful engineering requires profitable investments
Best regards
Iñaki
[Updated on: Sun, 12 July 2020 16:48] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 01:37:11 CEST 2025
Total time taken to generate the page: 0.00716 seconds
|