In this
page, to deal with the Mathematics function of school textbook.
Mainly, Differential, Integral and
Calculation of sum I£.
c.f.
Sample Program: "smp_diff.bas"
Practical usage is described at
lower part of the reference.
The formula about 'x' are dealt
with by character string.
So
formula level operations in string are possible.
About omission of "*"
3x^2+4x+1a??a?|(1)
3*x^2+4*x+1a??a?|(2)
In mathematics, it is usually
written like -(1).
The formula
recognized by 'Basic' need '*'(multiplication)
in front of the variable'x'
without omission like -(2).
The formula to give to
function, it is possible to use both (1) and (2).
((1) is converted to (2)
internally, and processed)
The
formula(string) returned by function is always returned in format-(2).
The formula(string) returned by
format-(2),
it is, -by
assigning a numerical value for 'x',
it can calculate by 'calc()' as it
is, and able to get the value.
e.g.
f$=fcal("x+3","2*x+2","add")
:'2-formulas are added and result'3*x+5' enter to 'f$'
x=2 :'substitute 2 for x
print calc(f$) :'calculate '3*x+5'
with assigned value
11
:'result'11' is displayed
And, 'x'-coefficient of formula's
calculation result,
it may
become irrational number which cannot divide,
then, the result output of formula
will be returned by not [a decimal]
but [fraction enclosed by
parentheses], like a "(1/3)*x^3+(5/2)*x^2".
e.g. in the case of integral
calculation
print
intgr$("x^2+5*x")
(1/3)*x^3+(5/2)*x^2
| GCD |
[Features] To find solution of
greatest common divisor.
[Format] GCD(n1,n2)
[e.g.]
print gcd(30,42)
6
| LCM |
[Features] To find solution of least
common multiple.
[Format] LCM(n1,n2)
[e.g.]
print lcm(30,42)
210
| PRIME |
[Features] To return the first prime
number on and after a specified number.
[Format] PRIME(n)
[Explanation]
When n is a prime number, n is
returned,
so it can also use
for distinction of whether n is prime number.
[e.g.]
print prime(12)
13
| ROOT |
[Features] To find the n-th root of
x.
[Format] ROOT(n,x)
[Explanation]
This is an approximation.
n√x (n is dimensions number, the
upper left mini symbol, not multiplication)
A number that is multiplied by 'n'
times to became 'x'.
SQR is
only the square, it can find n-th root of three or more dimensions.
[e.g.]
r=root(3,100)
print r
4.6415889136718755
print r^3
100.00000517446294
| FAC |
[Features] The factorial of n is
returned.
[Format] FAC(n)
[Explanation]
(The product of all the integers
from 1 to n)
The case of
'fac(5)', it will be 1*2*3*+4*5=120.
[e.g.]
print fac(5)
120
| PERM |
[Features] To return number of cases
of permutation of mathematics.
[Format] PERM(n,r)
[Explanation]
It is calculation represented by
'nPr'.
The total number of
branches that take 'r' pieces out
from different 'n' pieces,
and put in order.
The case of
'6P3', it will be 6*5*4=120.
[e.g.]
print perm(6,3)
120
| COMB |
[Features] To return number of cases
of combination of mathematics.
[Format] COMB(n,r)
[Explanation]
It is calculation represented by
'nCr'.
The total pattern number
that select 'r' pieces from different 'n' pieces.
This value is obtained by
PERM(n,r)/FAC(r).
[e.g.]
print comb(5,3)
10
| SIGMA |
[Features] The sum of number
sequence is calculated.(mathematics Σ)
[Format] SIGMA(n1,n2)
[Explanation]
4
Σ (x+1)
(in this case n1=1,n2=4)
x=1
The case 'sigma("x+1",1,4)'
then,
to substitute '1 to
4: increasing' for 'formula x',
and the value adding all the
results is returned.
This
'formula of Σ' can be calculated including general functions as
sin(),cos(),etc.
It also have the function to make
various settings.
Form2:
sigma("int"|"even"|"odd")
Although increment is usually 1,(default a=sigma("int"))
it can specify the following.
add only when even:
a=sigma("even")
add only when
odd : a=sigma("odd")
And although the target
variable is 'x' by default,
it can change into any
variables by 'a=sigma("v:y")'.
Form2: sigma("v:1chaVariableName")
(to describe 1character
Variable-Name next to "v:)
The
variable specified here is also applied to target variable of
differential/Integration/fcal function.
[e.g.]
print sigma("2*x^2+1",1,4)
64
a=sigma("v:y")
print sigma("2*y^2+1",1,4)
64
a=sigma("odd"):a=sigma("v:x")
print sigma("2*x^2+1",1,4)
22
| DERIV$ |
[Features] The given formula is
differentiated and it is made a Derivative function.
[Format] DERIV$(formula-string)
[Explanation]
The result is returned
by the formula of a character string.
f'(x)=lim f(x+h)-f(x)
h→0 /h
formula "x^n" then, Derivative
function of result will be "n*x^(n-1)"
[e.g.]
print deriv$("x^2+2*x+1")
2*x+2
| DIFF |
[Features] To find solution of
Differential coefficient.
[Format] DIFF(formula-string,n)
[Explanation]
The formula is made into
Derivative function,
and
the value which substituted 'n' for 'x' is acquired.
Differential coefficient will be
the slope of a tangent at the time of the formula'x=n'.
[e.g.]
print diff("x^2+2*x+1",4)
10
| INTGR$ |
[Features] The given formula is
integrated and it is made a Primitive function.
[Format] INTGR$(formula-string)
[Explanation]
∫ f(x)
dx [f(x) is "2*x+2" in example case]
It is returned by the formula of a
character string.
Integration
is the inverse operation of differentiation.
formula "a*x^n" then, the result
formula of integration will be "a/(n+1)*x^(n+1)"
The result is the one without the
integral constant 'C'.
[e.g.]
print intgr$("2*x+2")
x^2+2*x
print intgr$("x^2+5*x")
(1/3)*x^3+(5/2)*x^2
| DINT |
[Features] To find solution of
Definite integral.
[Format] DINT(formula-string,n1,n2)
[Explanation]
4
∫ f(x)
dx [f(x) is "2*x+2" in example case]
1
The formula is made into Primitive
function F(x),
and
substitute 'x' for 'n1' and 'n2',
and the value F(n2)-F(n1) is
acquired.
When formula is
'x^2', Definite integral result become an area of part
enclosed between x-axis and
parabola of formula, range n1<=x<=n2.
[e.g.]
print dint("2*x+2",1,4)
21
| FCAL |
[Features] To calculate formula 1
and 2 for 'x'(default) given by string, and return the result as string.
[Format] FCAL(formula-string1,formula-string2,"add"|"sub"|"mult")
[Explanation]
To specify "add" or
"sub"(subtraction) or "mult"(multiplication) with 3rd parameter.
It is possible to calculate
formula whose coefficient is integer.
The formula including fractions
are not supported at the moment.
[e.g.]
print fcal("x+3","2*x+2","add")
3*x+5
print
fcal("x^2+1","2x-2","mult")
2*x^3-2*x^2+2*x-2
| CHEM$ |
[Features] This retrieves various physical properties and basic information regarding chemical elements.
## [1] Basic Usage
The basic syntax of the function is as follows. Both parameters are passed asstring values.
```
CHEM$("Element Number or Name", "Property Name")
```
■ Parameter Specifications
[1st Parameter: Element Identifier]
・Atomic Number : "1" to "118" (zero-padding such as "01" is supported)
・Symbol : "H", "Fe", etc.
・English Name : "Hydrogen", "Iron", etc.
[2nd Parameter: Property Identifier]
・Property Index: "1" to "30"
・Property Name : "Melting Point", "Atomic Weight", etc.
■ Notation Flexibility
・English inputs are case-insensitive ("FE", "fe", and "Iron" are all accepted).
・Slash-separated property names (e.g., "Classification/Element Classification")
can be abbreviated to "Classification" or "Element Classification".
---
## [2] Unit Display Toggle (Special Command)
You can toggle whether physical units (℃, g/cm³, kJ/mol, pm, etc.) are attached
to the returned values.
・Enable Units (ON) : chem("unit", "on")
・Disable Units (OFF): chem("unit", "off") *Default setting
---
## [3] Return Value Specifications & Data Formats
All return values are provided as String types. Output data falls into three
structural formats. When parsing returned values in your application, split
the strings accordingly.
(1) Single Data
Example: "1537", "Solid"
(2) Multiple Data (Comma ',' separated)
Example: "737.7,1450.7", "+2,+3"
(3) Range Data (Tilde '~' separated)
Example: "12~34" (Used for atomic weights or densities with natural variation)
*Notes
・When the unit flag is set to ON, units are appended to each individual value
in multiple or range data.
(e.g., "737.7 kJ/mol,1450.7 kJ/mol" / "12 g/cm³~34 g/cm³")
・For unmeasured properties, non-existent elements, or invalid property queries,
an empty string "" is returned.
---
## [4] Supported Property Index (All 30 Properties)
No | Property Name
----+---------------------------------------------------------------------------
1 | Atomic Number
2 | Symbol
3 | Element Name/English Name
4 | (Reserved for local language name)
5 | Mass Number
6 | Atomic Weight/Relative Atomic Mass
7 | Electron Configuration
8 | Crystal Structure
9 | CAS Registry Number
10 | Discovery Year
11 | Discoverer/Country of Discovery
12 | Classification/Element Classification
13 | State/State of Matter
14 | Radioactivity
15 | Isotopes
16 | Representative Compounds
17 | Group Number
18 | Period Number
19 | Melting Point
20 | Boiling Point
21 | Specific Gravity
22 | Density
23 | Oxidation State/Valence
24 | Electronegativity
25 | Electron Affinity
26 | Ionization Energy
27 | Atomic Radius
28 | Covalent Radius
29 | Van der Waals Radius
30 | Hardness/Mohs Hardness/Vickers Hardness
---
## [5] Property Descriptions & Data Variations
Fundamental properties (Atomic Number, Period, Group, CAS Number, etc.) are
fixed, standardized values. Conversely, physical quantities and microscopic
properties (radii, hardness, oxidation states, etc.) may vary across databases
depending on experimental conditions, sample purity, allotropes, and theoretical
models. These values should be used as approximate guidelines.
1. Atomic Number
The number of protons in the atomic nucleus.
2. Symbol
1 to 2-letter chemical symbol.
3. Element Name/English Name
Standard English name registered with IUPAC.
5. Mass Number
Total number of protons and neutrons in the most common isotope.
6. Atomic Weight/Relative Atomic Mass
Average mass of natural isotopes.
*An increasing number of elements are listed as ranges in standard IUPAC
tables due to isotopic abundance variations depending on geological origin.
7. Electron Configuration
Distribution of electrons across electron shells (K shell outward).
8. Crystal Structure
Representative crystal lattice of the element at room temperature and pressure.
*May vary with allotropes or temperature.
9. CAS Registry Number
Unique international identifier for chemical substances.
10. Discovery Year
The year the element was isolated, identified, or synthesized.
11. Discoverer/Country of Discovery
Name of the discoverer and the country where research was conducted.
12. Classification/Element Classification
Categorization by chemical behavior (Metal, Nonmetal, Noble Gas, Alkali Metal,
etc.).
13. State/State of Matter
Physical state (Solid, Liquid, Gas) under standard conditions (25°C, 1 atm).
14. Radioactivity
Indicates whether the element lacks stable isotopes and is radioactive.
15. Isotopes
Major naturally occurring isotopes and their relative abundances
(Mass Number|Abundance %).
16. Representative Compounds
Common chemical formulas formed by the element.
17. Group Number
Vertical columns in the periodic table (Groups 1–18).
18. Period Number
Horizontal rows in the periodic table (Periods 1–7).
19. Melting Point / 20. Boiling Point
Phase transition temperatures.
*Sublimation at high temperatures or theoretical calculations for superheavy
elements can lead to variations across sources.
21. Specific Gravity / 22. Density
Mass per unit volume.
*Values may span a range due to allotropes, crystal defects, or differing gas
measurement standards.
23. Oxidation State/Valence
Common oxidation states in compounds.
*Sources differ on whether they list only primary oxidation states or include
rare states.
24. Electronegativity
Tendency of an atom to attract shared electrons.
*Values depend on the scale used (e.g., Pauling scale, Allred-Rochow scale).
25. Electron Affinity
Energy released when an electron is added to form a negative ion
(1st electron affinity).
26. Ionization Energy
Energy required to remove an electron to form a positive ion.
27. Atomic Radius / 28. Covalent Radius / 29. Van der Waals Radius
Measures of atomic size.
*Values vary significantly across research groups depending on experimental
method (e.g., X-ray crystallography), coordination number, and bonding models.
30. Hardness/Mohs Hardness/Vickers Hardness
Resistance to scratching or indentation.
*Values fluctuate between databases due to crystal orientation, purity, and
measurement difficulties in ductile metals.