If your aim is to use floating point numbers, pgfmath is not good. Look at the following example.
\documentclass{article}
\usepackage{xfp}
\usepackage{pgfmath}
\ExplSyntaxOn
\NewDocumentCommand{\setvar}{mm}
{
\fp_zero_new:c { l_flobue_var_#1_fp }
\fp_set:cn { l_flobue_var_#1_fp } { #2 }
}
\NewExpandableDocumentCommand{\usevar}{m}
{
\fp_use:c { l_flobue_var_#1_fp }
}
\ExplSyntaxOff
\begin{document}
\section{PGF}
\pgfmathsetmacro\varA{123.45}
\pgfmathsetmacro\varB{0.012345}
\pgfmathsetmacro\varC{\varA/\varB}
\verb|\varA| is \varA \
\verb|\varB| is \varB \
\verb|\varC| is \varC
\section{xfp}
\setvar{A}{123.45}
\setvar{B}{0.012345}
\setvar{C}{\usevar{A}/\usevar{B}}
\verb|A| is \usevar{A} \
\verb|B| is \usevar{B} \
\verb|C| is \usevar{C}
\setvar{B}{0.0012345}
\setvar{C}{\usevar{A}/\usevar{B}}
\noindent
Now \verb|C| is \usevar{C}; try with pgfmath
\end{document}

There are several advantages in the xfp approach with \setvar and \usevar:
- greater accuracy
- larger range
- no
\pgfmathsetmacro that does no check about the command being defined
- greater flexibility
The fourth point is worth an example: if you need to use the result of the previous division, you can simply do
\fpeval{\usevar{A}/\usevar{B}}
and don't need to set another variable for getting the result expandably.
\pgfmathparse. Have a look at https://tex.stackexchange.com/questions/337831/pgfmathparse-basic-usage – Raven Nov 24 '20 at 09:16