A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
15
Task/Arithmetic-Rational/Icon/arithmetic-rational-3.icon
Normal file
15
Task/Arithmetic-Rational/Icon/arithmetic-rational-3.icon
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
record rational(numer, denom, sign) # rational type
|
||||
|
||||
addrat(r1,r2) # Add rational numbers r1 and r2.
|
||||
divrat(r1,r2) # Divide rational numbers r1 and r2.
|
||||
medrat(r1,r2) # Form mediant of r1 and r2.
|
||||
mpyrat(r1,r2) # Multiply rational numbers r1 and r2.
|
||||
negrat(r) # Produce negative of rational number r.
|
||||
rat2real(r) # Produce floating-point approximation of r
|
||||
rat2str(r) # Convert the rational number r to its string representation.
|
||||
real2rat(v,p) # Convert real to rational with precision p (default 1e-10). Warning: excessive p gives ugly fractions
|
||||
reciprat(r) # Produce the reciprocal of rational number r.
|
||||
str2rat(s) # Convert the string representation (such as "3/2") to a rational number
|
||||
subrat(r1,r2) # Subtract rational numbers r1 and r2.
|
||||
|
||||
gcd(i, j) # returns greatest common divisor of i and j
|
||||
Loading…
Add table
Add a link
Reference in a new issue