FIND YOUR NEXT FEW LINES
Results for “fraction”
Small, practical examples. Search by task or narrow things down below.
19 snippets foundClear filters
Set and inspect a fractional CPU limit
Docker / Compose: The cpus option records a limit in units of one billion NanoCPUs.
Docker / Compose✓ Tested
Calculate with exact rational values
Python: Use Fraction for exact ratios rather than binary floating-point approximations.
Python✓ Tested
Divide grid space in a chosen proportion
CSS: Fraction units divide the remaining track space proportionally.
CSS✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Convert a duration to another unit explicitly
C++: duration_cast converts units and truncates fractional integer units.
C++✓ Tested
Format a decimal value
Print two fractional digits with C printf.
C✓ Tested
Interpolate between two calibration points
Arduino / C: Compute a fractional position before scaling to the output interval.
Arduino / C✓ Tested