About varocarbas.com


About me


Contact me


Visit customsolvers.com, another side of my work


Valid markup


Valid CSS


© 2015-2017 Alvaro Carballo Garcia


URL friendly


Optimised for 1920x1080 - Proudly mobile unfriendly

R&D projects RSS feed

All projects in full-screen mode


Project 10

Project 9

Project 8

FlexibleParser code analysis:




Chromatic encryption

(v. 1.3)

Pages in customsolvers.com:

Upcoming additions

Failed projects

Active crawling bots:

Ranking type 2


Currently active or soon to be updated:

Domain ranking

FlexibleParser (DateParser)

Project 10 is expected to be the last formal project of varocarbas.com. I will continue using this site as my main self-promotional R&D-focused online resource, but by relying on other more adequate formats like domain ranking.
Note that the last versions of all the successfully completed projects (5 to 10) will always be available.
Completed (24 days)
Completed (57 days)
Completed (26 days)
Completed (47 days)
Completed (19 days)
Completed (14 days)

Introduction >

NumberParser Code >

Custom mathematical functionalities

Math2 includes all the mathematical functionalities of NumberParser, divided into the following two main groups:
  • Non-natively-supported implementations, which I developed from scratch and are analysed below. All this code is stored in the files and folders including "New" in their names.
  • NumberD-adapted versions of the .NET native System.Math methods, which are discussed in the next section. These implementations are included in the "Existing" files and folder.
Math2 contains the following custom methods:
  • PowDecimal/SqrtDecimal. These decimal-based methods are more accurate and support higher precisions/ranges (i.e., up to 26 decimal digits and over ±10^2147483647) than their native floating-point counterparts (i.e., System.Math's Pow/Sqrt).
    Project 10 analyses both algorithms and the underlying calculation approach in detail.
  • RoundExact/TruncateExact. They extend System.Math's Round/Truncate functionalities by bringing into account new scenarios (e.g., rounding/truncating before/after the decimal point via RoundSeparator) or by complementing existing ones (e.g., RoundType.MidpointToZero, an eventuality not accounted by the native MidpointRounding).
    Note that the structure of these two methods was an output of one of my CoreFX issues.
  • GetPolynomialFit/ApplyPolynomialFit. These methods calculate (least squares) and apply the coefficients of a second degree polynomial fit.
    GetPolynomialFit returns a Polynomial variable with the coefficients best fitting the training x/y arrays. This output, together with the dependent value associated with the result to be calculated, is taken by ApplyPolynomial to perform the corresponding calculations (i.e., A + B*x + C*x^2).
  • Factorial. It calculates the factorial of any positive integer number up to 99999.