New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classical Mathematics Support #22
Comments
What would be |
Dear DV,
That function name represents the square root of a rational number. As a Multiprecision Rational,
The first 80 significant figures, to a precision of 80, are:
sqrt(2) -> 1.414213562373095048801688724209698078569671875376948073176679737990732478462107...
Admittedly, when an (mpz) or (mpr) is declared, and before it is assigned, you will need to probably use the (text)
type to specify defaulting precision of a number type, before it is assigned to or operated on or by.
…________________________________
From: Daniele Varrazzo ***@***.***>
Sent: Saturday, 21 August 2021 8:20 PM
To: dvarrazzo/pgmp ***@***.***>
Cc: PowerUser1234 ***@***.***>; Author ***@***.***>
Subject: Re: [dvarrazzo/pgmp] Classical Mathematics Support (#22)
What would be sqrt(2) as an mpq?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#22 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AH5CA6COV6TXTJK6G7LFPX3T554WLANCNFSM5CRKKVQQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
Dear DV,
In addition to the issues to change I have posted at:
#22
mpz and mpz should have both the ability
to specify precision and the start, or specify
no precision at the start, whereby its non-specify precision
could be, say, 100 significant figures to start, with
room for a larger range, by TEXT type parameter.
?
|
mpq represent rational numbers, not transcendent numbers or their approximations. What you have in mind is probably closer to providing approximate floating point numbers and functional such as wrapping the mpfr library. This is not a minor task and will not happen unless the project is sponsored. |
What I am after is arithmetic and functions support via two number types: Integers and limited precision Rational Okay. From there I have two questions.
|
-Integer (HPZ) Z, or Rational Decimal Q (HPQ) numbers support.
The fact is that recurring Rational Numbers and recurring Irrational Numbers can be appropriately
truncated, by a precision value, to obtain an approximating value, a finite Rational
value, with integer and decimal parts at the same time.
-A defaulting number of significant figures (precision), say, 100, and a constructor for otherwise.
HPZ(1000) or HPQ(1000), or HPZ, HPQ just on their own, with no more specified.
-Value assignment by =. The ability to specify type without any text data in a constructor.
-Base 10 Arithmetic and comparisons support on Base 10 Integer and Rational Decimal numbers.
+,-,*,/,%,^,=,!=,<>,>,<,>=,<=, ::
These include full finite division and integer only division, with no remainder.
-When operating on two multiprecision numbers, you take the largest precision of the two,
by default, for the precision of the result. If this precision is not large enough for the
meaningful result, in terms of all integer places and at least one decimal place, there should be
a precision exception. Because of this, you need the option to learn of and enlarge the larger
of the two precisions, and to try again. And of course an exception catching block.
setPrecision(HPQ value1, INTEGER getPrecision(HPQ value1) + 1);
setPrecision(HPZ value2, INTEGER getPrecision(HPZ value2) + 1);
-Mathematical and Operational functions support:
cast(TEXT as HPZ) returns HPZ;
cast(TEXT as HPQ) returns HPQ;
cast(HPQ as text) returns TEXT;
cast(HPZ as text) returns TEXT;
cast(HPZ as HPQ) returns HPQ;
cast(HPQ as HPZ) returns HPZ;
getPrecision(HPZ input) returns INTEGER output;
getPrecision(HPQ input) returns INTEGER output;
setPrecision(HPZ value, INTEGER precision);
setPrecision(HPQ value, INTEGER precision);
sign(HPQ input) returns HPQ;
abs(HPQ input) returns HPQ;
ceil(HPQ input) returns HPQ;
floor(HPQ input) returns HPQ;
round(HPQ input) returns HPZ;
pi(INTEGER places) returns HPQ;
e(INTEGER places) returns HPQ;
power(HPQ base, HPQ exponent) returns HPQ;
sqrt(HPQ input) returns HPQ
nroot(HPZ theroot, HPQ input) returns HPQ;
log10(HPQ input) returns HPQ;
loge(HPQ input) returns HPQ;
log2(HPQ input) returns HPQ;
factorial(HPZ input) returns HPZ;
degrees(HPQ input) returns HPQ;
radians(HPQ input) returns HPQ;
sind(HPQ input) returns HPQ;
cosd(HPQ input) returns HPQ;
tand(HPQ input) returns HPQ;
asind(HPQ input) returns HPQ;
acosd(HPQ input) returns HPQ;
atand(HPQ input) returns HPQ;
sinr(HPQ input) returns HPQ;
cosr(HPQ input) returns HPQ;
tanr(HPQ input) returns HPQ;
asinr(HPQ input) returns HPQ;
acosr(HPQ input) returns HPQ;
atanr(HPQ input) returns HPQ;
-Informative articles on all these things exist at:
Arithmetic Operations: https://en.wikipedia.org/wiki/Arithmetic
Integer Division: https://en.wikipedia.org/wiki/Division_(mathematics)#Of_integers
Modulus Operation: https://en.wikipedia.org/wiki/Modulo_operation
Factorial Operation: https://en.wikipedia.org/wiki/Factorial
Comparison Operators: https://en.wikipedia.org/wiki/Relational_operator
Degrees: https://en.wikipedia.org/wiki/Degree_(angle)
Radians: https://en.wikipedia.org/wiki/Radian
Elementary Functions: https://en.wikipedia.org/wiki/Elementary_function
-Ease of installation support. Particularly for Windows and Linux. *.exe, *.msi or *.rpm, *.deb, *.bin installers.
With a PostgreSQL standard installation.
The following chart could be used to help test trigonometry outputs:
https://www.livingston.org/cms/lib9/NJ01000562/Centricity/Domain/742/calc/Trig%20functions%20chart%20-%20answers.pdf
The text was updated successfully, but these errors were encountered: