Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

SamplePaclet

Guides

  • Sample Guide

Tech Notes

  • Arithmetic

Symbols

  • AddOne
  • AddTwo
Arithmetic
Arithmetic is hard. This tutorial does not address that in any way. If anything, this will make it harder. SamplePublisher/SamplePaclet gives you all the functions you need to do harder-than-necessary arithmetic.
AddOne
add one to something
AddTwo
add two to something
Two uninteresting functions (one is less interesting than the other).

Natural numbers

Create a revolutionary function that gives you the
th
n
natural number:
In[1]:=
naturalNumber[n_]:=Nest
AddOne
,0,n;
Simply incredible:
In[2]:=
naturalNumber[5]
Out[2]=
5
The number 24 was previously believed to be the highest number:
In[3]:=
naturalNumber[24]
Out[3]=
24
Achieve a new record:
In[4]:=
naturalNumber[46]
Out[4]=
46

Addition

AddOne
is all you need to add any numbers:
In[1]:=
plus[x_,y_]:=Nest
AddOne
,x,y;
In[2]:=
plus[3,4]
Out[2]=
7
This is a really big number:
In[3]:=
plus[42,1337]
Out[3]=
1379
Assume that negative numbers do not exist:
In[4]:=
plus[5,-3]
Nest
:Non-negative machine-sized integer expected at position 3 in Nest[AddOne,5,-3].
Out[4]=
Nest[AddOne,5,-3]
Real numbers are too weird to be used in arithmetic anyway:
In[5]:=
plus[5,1.23]
Nest
:Non-negative machine-sized integer expected at position 3 in Nest[AddOne,5,1.23].
Out[5]=
Nest[AddOne,5,1.23]

Multiplication

AddOne
is all you need to multiply any numbers:
In[6]:=
times[x_,y_]:=Nest[OperatorApplied[plus][x],0,y];
In[7]:=
times[3,4]
Out[7]=
12
Just look at the absolute size of this number:
In[8]:=
times[42,1337]
Out[8]=
56154

Advanced Mathematics

Subtraction and division are considered very difficult and should be left to professionals.
RelatedGuides
▪
Sample Guide
​
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com