calc_rational

CLI calculator for rational numbers.
git clone https://git.philomathiclife.com/repos/calc_rational
Log | Files | Refs | README

commit e352471950c398864ae93e315534887680fb5abb
parent eeea777247ac20a3a2023970e88d6d62f739dc0c
Author: Zack Newman <zack@philomathiclife.com>
Date:   Tue,  2 May 2023 12:30:47 -0600

more doc fixes

Diffstat:
MREADME.md | 2+-
Mlang.tex | 6+++---
Msrc/lib.rs | 2+-
Msrc/main.rs | 2+-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -82,7 +82,7 @@ then an error will be displayed. Spaces and tabs are *not* ignored; so `1 !` is will result in an error message. `^` is the exponentiation operator. The expression left of the operator can evaluate to any rational number; -however the expression right of the operator must evaluate to an integer or (+/-) 1/2 unless the expression on +however the expression right of the operator must evaluate to an integer or ±1/2 unless the expression on the left evaluates to `0` or `1`. In the event of the former, the expression right of the operator must evaluate to a non-negative rational number. In the event of the latter, the expression right of the operator can evaluate to any rational number. Note that `0^0` is defined to be 1. diff --git a/lang.tex b/lang.tex @@ -55,9 +55,9 @@ and \(mod\) to mean absolute value, negation, factorial, exponentiation, and mod Note that this means for \(mult / exp\), \(exp\) does not evaluate to 0. Similarly, \(term\string^exp\) is valid iff \(term\) evaluates to 1, \(term\) evaluates to 0 and \(exp\) evaluates to a non-negative rational number—\(0^{0}\) is -defined to be 1—or \(term\) evaluates to any other rational number and \(exp\) evaluates to an integer. \(!\) is -only defined for non-negative integers. \(@prev\) is only defined iff at least \(prev\) number of previous \(store\) -expressions have been evaluated. +defined to be 1—or \(term\) evaluates to any other rational number and \(exp\) evaluates to an integer or \(\pm1/2\). +\(!\) is only defined for non-negative integers. \(@prev\) is only defined iff at least \(prev\) number of previous +\(store\) expressions have been evaluated. \(mod\) is defined iff the left operand evaluates to an integer and the right operand evaluates to a non-zero integer. This operator returns the minimum non-negative integer, \(r\), that satisfies the equation diff --git a/src/lib.rs b/src/lib.rs @@ -29,7 +29,7 @@ //! will result in an error message. //! //! `^` is the exponentiation operator. The expression left of the operator can evaluate to any rational number; -//! however the expression right of the operator must evaluate to an integer or (+/-) 1/2 unless the expression on +//! however the expression right of the operator must evaluate to an integer or ±1/2 unless the expression on //! the left evaluates to `0` or `1`. In the event of the former, the expression right of the operator must evaluate //! to a non-negative rational number. In the event of the latter, the expression right of the operator can evaluate to //! any rational number. Note that `0^0` is defined to be 1. diff --git a/src/main.rs b/src/main.rs @@ -81,7 +81,7 @@ //! will result in an error message. //! //! `^` is the exponentiation operator. The expression left of the operator can evaluate to any rational number; -//! however the expression right of the operator must evaluate to an integer or (+/-) 1/2 unless the expression on +//! however the expression right of the operator must evaluate to an integer or ±1/2 unless the expression on //! the left evaluates to `0` or `1`. In the event of the former, the expression right of the operator must evaluate //! to a non-negative rational number. In the event of the latter, the expression right of the operator can evaluate to //! any rational number. Note that `0^0` is defined to be 1.