If you are wondering which command line utility to use on your Mac Terminal to do arithmetic calculations such as addition, subtraction or multiplication then you can make use of bc - An arbitrary precision calculator language, it ships with your macOS.

% man bc
bc(1) bc(1)
NAME
bc - An arbitrary precision calculator language
SYNTAX
bc [ -hlwsqv ] [long-options] [ file ... ]
VERSION
This man page documents GNU bc version 1.06.
DESCRIPTION
bc is a language that supports arbitrary precision numbers with inter-
active execution of statements. There are some similarities in the
syntax to the C programming language. A standard math library is
available by command line option. If requested, the math library is
defined before processing any files. bc starts by processing code from
all the files listed on the command line in the order listed. After
all files have been processed, bc reads from the standard input. All
code is executed as it is read. (If a file contains a command to halt
the processor, bc will never read from the standard input.)
Lets see some examples:
code2care@mac ~ % bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
20+10+30
60
a=10
b=20
a+b
30
(a+b)*100
3000
(10/20)*100
0
You can see that the division came out to be incorrect, that because the result is truncated to an integer, you would need to use the -l option to work with floats.
-l, --mathlib
Define the standard math library
code2care@mac ~ % bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
(10/20)*100
50.00000000000000000000
- Add Line Break in Microsoft Excel Cell on Mac (macOS)
- How to view the desktop when using macOS Stage Manager?
- Mac - How to Install VirtualBox
- Must Know Homebrew Commands for Mac/Linux Users
- Show Desktop Keyboard Shortcut on Mac
- Check Reboot History Mac
- How to set Out Of Office (OOO) on Outlook for Mac
- How to Screenshot on Mac Ventura 13 - Step by Step Guide
- How to install maven in macOS using Terminal Command
- How to change macOS Safari default language
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- Permanently Set or Change $JAVA_HOME on Mac (macOS)
- Two Ways to Extract rar (*.rar) files on Mac
- How to change Ping TTL value on macOS
- How to upgrade Docker Desktop on Mac
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- Installing brew on M1/M2 ARM Mac
- How to increase macOS Terminal text font size (Big Sur)
- How to open new tab in Sublime Text Editor [macOS]
- macOS: Change Weather App Temperature unit from Fahrenheit to Degree
- Clear SFTP Prompt Screen on macOS Terminal
- How to install homebrew (brew) on M1 Mac
- [Fix] brew: command not found Mac or Linux Terminal Error
- How to download and install macOS 13 Ventura
- How to install Zoom Add-in to Outlook (Mac)
- [Solved] Bootstrap tooltip not working - Bootstrap
- How to pip install Python Modules in VSCode - Python
- How to pass value to another Power Apps screen - PowerApps
- Create Nested Directories using Java Code - Java
- List of All 35 Reserved Keywords in Python Programming Language 3.11 - Python
- Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later. - Android
- How to change bash terminal prompt string and color - Linux
- Convert JSON to Java Collection Map using Jackson - Java