Questions tagged [xfp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
91 views

Evaluating expressions using xfp

I want to generate two integer random numbers for the radius (r) and heigth (h) of a cilinder, in a certain question of my exam. I am using the package xfp to generate the random numbers. However, I ...
4
votes
3answers
70 views

Removing cumulative sum + defining local variables + if

The below code is wrong but it illustrates what I am trying to achieve. How would you write the g command? \usepackage{xfp} \newcommand{\f}[1]{ \inteval{(#1 - \a) / (\b - \a)} } \newcommand{\g}[1]{...
0
votes
2answers
55 views

Is it possible to evaluate an integral using the xfp package?

I am curious if it is possible to evaluate an integral using the xfp package using tex language? \fpeval{\int_{-1}^{1}\frac{1}{\sqrt{1 - x^2}}dx}} Just throwing out the idea. I know I can easily do ...
0
votes
0answers
46 views

How to create a line-spacing command like `\doublespacing` but for an arbitrary factor?

The setspace package provides a couple of multi-line spacing commands, like \doublespacing. But as far as I can see, it does not provide a simple spacing command by an arbitrary factor. It provides \...
2
votes
1answer
89 views

On the xfp package: ternary operator x ? y : z

On page 1/2 xfp package we see ternary operator x ? y : z as a valid boolean expression. it deserves the author puts at least the definition of this. In C I was told we have: variable = Expression1 ? ...
7
votes
1answer
122 views

The difference between {\x >\y} and {\x >? \y} in xfp package?

On page 1/2 of xfp package we see x >? y as a valid comparison operator. Is it different from x>y? I think they are equivalent based on my following code, but not sure: \documentclass{article} ...
1
vote
1answer
105 views

On the xfp package: Comparison

On page 1/2 of the xfp package we read: The floating point expressions may comprise:Comparison operators: x < y, x <= y, x >? y, x ! = y etc. However they did not show an example. Below I ...