% This file is embedded in datatool-user.pdf version 3.4.2 2025-11-06
% Example 33 Numerical/String Comparisons
% Label: "ex:DTLif"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
 \usepackage[math=l3fp]{datatool-base} 
\begin{document}
1 = 1.0? (numeric) \DTLifeq{1}{1.0}{true}{false}. 

1p = 1.0p? (string) \DTLifeq{1p}{1.0p}{true}{false}. 

2 lt 10? (numeric) \DTLiflt{2}{10}{true}{false}. 

A2 lt A10? (string) \DTLiflt{A2}{A10}{true}{false}. 

2.0 gt 10.0? (numeric) \DTLifgt{2}{10}{true}{false}. 

A2.0 gt A10.0? (string) \DTLifgt{A2.0}{A10.0}{true}{false}. 

10 between 1 and 20 (numeric, exclusive)?
\DTLifopenbetween{10}{1}{20}{true}{false}. 

10p between 1p and 20p (string, exclusive)?
\DTLifopenbetween{10p}{1p}{20p}{true}{false}. 

1 between 1.0 and 2 (numeric, inclusive)?
\DTLifclosedbetween{1}{1.0}{2}{true}{false}. 

1 between 1.0 and 2A (string, inclusive)?
\DTLifclosedbetween{1}{1.0}{2A}{true}{false}. 
\end{document}
