Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Why 1.26 cubic metres of concrete comes out as 70 bags, or 71, depending on where you round

A 4 by 3 metre slab at 100 mm deep is 1.2 cubic metres. Add the usual 5 percent margin and you have 1.26. Divide by the yield on the bag and the order should be 70 bags. Written as code, that calculation returns 71, and the extra bag is not a rounding-up for safety. It is a rounding error, and it is one of four places where the same order can drift by a bag or by fifteen. This is a small post…

The calculation of concrete bags for a slab depends on four factors: volume, margin, bag yield, and rounding precision. A 4 m by 3 m slab with a 0.1 m depth requires 1.26 cubic meters of concrete, accounting for a 5% margin. The yield of a 36 kg bag is 0.018 cubic meters. Using the formula volume / bag yield results in 70.00000000000001, and rounding up using Math.ceil() gives 71 bags.

However, rounding the ratio before applying the ceiling can yield 70 bags. The order of operations also affects the result, as applying the margin before or after the division, or to the rounded result, produces different outcomes. The margin chosen can significantly impact the final result, with a 10% margin resulting in 74 bags for the same slab.

To avoid ambiguity and ensure consistency, it is crucial to keep the volume, margin, bag yield, and rounding precision in one place.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Multipath TCP vs Single-Path TCP: Why One Connection Refuses to Pick a Lane

For decades, a TCP connection has been defined by four numbers: the two addresses and the two ports at either end. Change one of them and the connection is over.

  • Multipath TCP (MP-TCP) maintains connection identity across network changes.
  • MP-TCP adds connection-level layer for seamless handshakes and subflow management.
  • Benefits include bandwidth aggregation and network continuity, but deployment faces challenges.

A peso that is worth zero for 55 steps, and the median ceases to be the median

A weight that is worth zero for 55 steps, and the median ceases to be the median The number An estimator of mine published 2.2380708362e+251 as the median of 3894 values.

  • A fictitious weight of zero affected 55 steps in a calculation
  • Median changed from correct value of 6.8003333871e+250 to 2.2380708362e+251
  • Problem occurred when scale exceeded representable state

Building ComfyUI custom nodes for a remote generation API: polling, tensors, VIDEO outputs and keeping keys out of workflows

ComfyUI is usually about running models on your own GPU, but a growing number of node packs call remote APIs instead: the graph stays local, the heavy lifting happens on someone else's hardware.

  • ComfyUI discovers custom nodes in customnodes/ directory
  • Node class includes INPUTTYPES, RETURNTYPES, and FUNCTION
  • Vellria API uses POST for image/video generation, returning 202 status

Twelve questions before any code

We're building a product for small organizations, and its newest piece is a tracked list of work with approval steps. When someone asks for something, it's held until a person says yes, then handed to…

  • Twelve questions addressed before coding began for small organization software
  • Final decision rested with intended users, not developers
  • Privacy ensured by limiting access to relevant roles only

My O(n ) Algorithm Ran in O(n) — and Why That Meant My Stress Test Was Wrong

For my algorithms course, I solved three variants of the text segmentation problem with dynamic programming, proved them correct, and stress-tested them. The most useful part wasn't the algorithms.

  • Student ran three variants of text segmentation problem using dynamic programming
  • Stress test showed variant (b) was linear (O(n)) instead of expected O(n²)
  • Inner loop optimization reduced IsWord calls from 2,001,000 to 2,000

More from Saturday, 28 November 2026 →