Brings in the calculator's powers and remainders. docs/TODO.md keeps both Completed Steps lines, the API one first. Model: opus-5-5
This commit is contained in:
+7
-5
@@ -25,7 +25,7 @@ import (
|
||||
const DisplayName = "calc"
|
||||
|
||||
// Welcome is sent to everyone whose contact request the bot accepts.
|
||||
const Welcome = "Send me arithmetic, such as 2 + 2 or 5 * 5/2, " +
|
||||
const Welcome = "Send me arithmetic, such as 2 + 2, 5 * 5/2, 2^10 or 7 % 3, " +
|
||||
"and I will reply with the result."
|
||||
|
||||
// ChatPort is where the chat client serves its API, on localhost inside
|
||||
@@ -275,10 +275,12 @@ func Reply(text string) string {
|
||||
calc.MaxInputLength)
|
||||
case errors.Is(err, calc.ErrDivisionByZero):
|
||||
return "I cannot divide by zero."
|
||||
case errors.Is(err, calc.ErrTooLarge):
|
||||
return "The result is too large for me."
|
||||
case errors.Is(err, calc.ErrOutOfRange):
|
||||
return "That needs a number too large or too small for me."
|
||||
case errors.Is(err, calc.ErrNoRealResult):
|
||||
return "A negative number to a fractional power has no real result."
|
||||
default:
|
||||
return "I only understand arithmetic: numbers, + - * / and " +
|
||||
"parentheses, such as 5 * 5/2."
|
||||
return "I only understand arithmetic: numbers, + - * /, ^ for a power, " +
|
||||
"% for a remainder, and parentheses, such as 5 * 5/2 or 2^10."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user