Posts

Showing posts from March 18, 2019

Test of integers? Or, round the number if the first two decimal numbers are sufficiently close to 0 or 1?

Image
6 0 The following is a MWE, which explains my intention. documentclass{article} usepackage{tikz} usetikzlibrary{math} begin{document} tikzmath{ integer = 4/2; decimal = 5/3; integerB=1/3*3; } $integer$ is an integer, and it should be printed as 2. And $decimal$ is a decimal number, I would like to round it to 1.7. Another difficulty is that $integerB$ is an integer in fact, and should be printed as 1. end{document} I wonder if it is possible to test a number to determine it is an integer. Alternatively, it would also be great if it is possible to determine whether the first two decimal numbers are sufficiently close to 0 or 1. tables tikzmath decimal-number share | improve this question