Skip to main content

Questions tagged [floating-point]

6 votes
1 answer
114 views

I just discovered that we can now create new functions (fp words) that can be evaluated inside \fp_eval:n per page 273 of interface3.pdf (it also seems to work with \fpeval). This is straightforward ...
LaTeXereXeTaL's user avatar
3 votes
1 answer
129 views

I cannot figure out how to test if an argument is a floating point or integer using expl3. Take this simple example where I convert \milk{number} into \dotfill, the number, and gallon or gallons with ...
Bob's user avatar
  • 1,512
7 votes
2 answers
269 views

The MWE is quite self-explaining: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfmath-xfp} \usetikzlibrary{math} \pgfmxfpdeclarefunction{test}{4}{ #1 * #3 - #2 * #4 } \begin{...
Yijun Yuan's user avatar
3 votes
1 answer
202 views

In l3fp, there are many expandable functions that expand to different representations of the result of computing an fp expression: \fp_eval:n, \fp_to_decimal:n, \fp_to_dim:n, \fp_to_int:n, \...
User23456234's user avatar
  • 2,428
3 votes
1 answer
103 views

In my testing with l3benchmark, wrapping dimens and dimen expressions within a floating point expression is always faster with \dim_to_decimal:n than with \dim_to_fp:n. Yet, in kernel code, ...
User23456234's user avatar
  • 2,428
2 votes
1 answer
154 views

I am trying to implement a function in LaTeX3 \check_if_fp:n that checks if an input can be parsed as a floating-point number (in an expandable way, so not using regexes). After a lot of thinking I ...
Vincent's user avatar
  • 6,225
0 votes
1 answer
103 views

I would like to design a \comparator expandable command that relies on fpeval that has 3 branches: true branch when the comparison is equal to 1 false branch when the comparison is equal to zero ...
Vincent's user avatar
  • 6,225
1 vote
2 answers
156 views

my question is quite simple, i want to construct a nuumberline for a homework and came up with the following code: \begin{tikzpicture} \draw(0,0)--(16,0); \foreach \x/\y in {0/0,1.6/0.2,...,16.2/2.1} \...
Daerker's user avatar
  • 13
9 votes
1 answer
258 views

pgfmanual.pdf, VII Utilities, Repeating Things: The Foreach Statement, says: \foreach \x in {0,0.1,...,0.5} {\x, } yields 0, 0.1, 0.20001, 0.30002, 0.40002, and warns about rounding-errors causing ...
user avatar
0 votes
0 answers
37 views

I'm writing a small macro to draw a curve given some parameters in Tikz: \newcommand{\beznorm}[4]{%x, y, width, height \def\x{#1}% \def\y{#2}% \def\w{#3}% \def\h{#4}% \def\sw{1/8 * ...
Svalorzen's user avatar
  • 296
4 votes
2 answers
675 views

How are floating point macros tested? Are comparisons made with other libraries not implemented in `LaTeX(3)'? Is the IEEE standard for floating point arithmetic respected?
projetmbc's user avatar
  • 15.5k
4 votes
3 answers
901 views

Are there packages that provide a command that can truncate a floating point number not to the nearest integer, but to an arbitrary decimal place? For instance, 2.59 truncated to the first decimal ...
Evan Aad's user avatar
  • 11.3k
2 votes
2 answers
150 views

The subtraction of the calculated height of an input via sbox (in this case = 116.43562 pt) and 17.68 pt gives an incorrect result at the 5th floating point. Here is the full tex file \usepackage[T1]{...
Bilal Yilmaz's user avatar
0 votes
2 answers
105 views

To pretty print large numbers with numeric suffix, this solution works fine, except the last test case (the poster already indicated that, so it is not unexpected). Surprisingly, 6260563123 is ...
sherlock's user avatar
  • 1,573
0 votes
1 answer
159 views

I wanted to make a tikzpicture, that includes numbers. It looks like this: My problem is, that I have no idea how to get rid of the .0 after every number. Can someone help me to get integers instead ...
Titanlord's user avatar
  • 561

15 30 50 per page