lseif,

char, short, int, long, long long

tetris11,
@tetris11@lemmy.ml avatar

unsigned long long and minus unsigned long long

derpgon,

I didn’t do C++ for over 5 years. Does minus unsigned really give you one bit of data extra?

sparky,
@sparky@lemmy.federate.cc avatar

Are we assuming we’re allowed to use defines and templates? 😏

derpgon,

B-b-but those are cheating 😒

insomniac_lemon,
insomniac_lemon avatar

KiB, MiB, GiB etc are more clear. It makes a big difference especially 1TB vs 1TiB.

The American way would probably be still using the units you listed but still meaning 1024, just to be confusing.

Either that or maybe something that uses physical measurement of a hard-drive (or CD?) using length. Like that new game is 24.0854 inches of data (maybe it could be 1.467 miles of CD?).

LodeMike,

The difference really needs to be enforced.

My ram is in GiB but advertised in GB ???

xionzui,

Your RAM is in GiB and GB. You can measure it either way you prefer. If you prefer big numbers, you can say you have 137,438,953,472 bits of RAM

p_consti,

Pretty sure the commenter above meant that the their RAM was advertised as X GiB but they only got X GB, substitute X with 4/8/16/your amount

xionzui,

As far as I know, RAM only comes in GiB sizes. There is some overhead that reduces the amount you see in the OS though. But that complaint is valid for storage devices if you don’t know the units and expect TB/GB on the box to match the numbers in Windows

middlemanSI,

MigaBytes?

mom,

MiB = mebibyte

survivalmachine,

The American way would probably be still using the units you listed but still meaning 1024, just to be confusing.

American here. This is actually the proper way. KB is 1024 bytes. MB is 1024 KB. The terms were invented and used like that for decades.

Moving to ‘proper metric’ where KB is 1000 bytes was a scam invented by storage manufacturers to pretend to have bigger hard drives.

And then inventing the KiB prefixes was a soft-bellied capitulation by Europeans to those storage manufacturers.

Real hackers still use Kilo/Mega/Giga/Tera prefixes while still thinking in powers of 2. If we accept XiB, we admit that the scummy storage vendors have won.

Note: I’ll also accept that I’m an idiot American and therefore my opinion is stupid and invalid, but I stand by it.

WalrusDragonOnABike,

Kilo comes from greek and has meant 1000 for 1000’s of years. If you want 2^10 to be represented using greek prefixes, it better involve “deca” and “di”. Kilo (and di) would be usable for roughly 1.071508607186267 x 10^301 byte. KB was wrong when it was invented, but they were only wrong for decades at least.

survivalmachine,

Computers have ruled the planet for longer than the Greeks ever did. The history lesson is appreciated, but we’re living in the future, now, and the future is digital.

LodeMike,

No the correct way is to use the proper fucking metric standard. Use Mi or Gi if you need it. We have computers that can divide large numbers now. We don’t need bit shifting.

PowerCrazy,

Hey how is “bit shifting” different then division? (The answer may surprise you).

LodeMike,

Bit shifting works if you wanna divide by 2 only.

PowerCrazy,

interesting, so does the computer have a special “base 10” ALU that somehow implements division without bit shifting?

nybble41,

In general integer division is implemented using a form of long division, in binary. There is no base-10 arithmetic involved. It’s a relatively expensive operation which usually requires multiple clock cycles to complete, whereas dividing by a power of two (“bit shifting”) is trivial and can be done in hardware simply by routing the signals appropriately, without any logic gates.

PowerCrazy,

In general integer division is implemented using a form of long division, in binary.

The point of my comment is that division in binary IS bitshifting. There is no other way to do it if you want the real answer. You can estimate, you can round, but the computational method of division is done via bitshifting of binarary expansions of numbers in an ALU.

nybble41,

The metric standard is to measure information in bits.

Bytes are a non-metric unit. Not a power-of-ten multiple of the metric base unit for information, the bit.

If you’re writing “1 million bytes” and not “8 million bits” then you’re not using metric.

If you aren’t using metric then the metric prefix definitions don’t apply.

There is plenty of precedent for the prefixes used in metric to refer to something other than an exact power of 1000 when not combined with a metric base unit. A microcomputer is not one one-thousandth of a computer. One thousand microscopes do not add up to one scope. Megastructures are not exactly one million times the size of ordinary structures. Etc.

Finally: This isn’t primarily about bit shifting, it’s about computers being based on binary representation and the fact that memory addresses are stored and communicated using whole numbers of bits, which naturally leads to memory sizes (for entire memory devices or smaller structures) which are powers of two. Though the fact that no one is going to do something as idiotic as introducing an expensive and completely unnecessary division by a power of ten for every memory access just so you can have 1000-byte MMU pages rather than 4096 also plays a part.

LodeMike,

If you aren’t using metric then the metric prefix definitions don’t apply.

Yes it does wtf?

mokus,

Or maybe metric should measure in Hartleys

firefly,
@firefly@neon.nightbulb.net avatar

The metric system is fascist. It was invented by aristocratic elitist control freaks. It is arbitrary and totalitarian.

https://archive.ph/EB5Qu

"The colorfulness and descriptiveness of the imperial system is due to the fact that it is rooted in imagery and analogies that make intuitive sense."

I'll save my own rant until after I've seen the zombies froth.

firefly,
@firefly@neon.nightbulb.net avatar

The meter is an French fascist measurement made by the court jester.

"Since 2019 the metre has been defined as the length of the path travelled by light in vacuum during a time interval of
1/299792458 of a second ..." [Wikipedia]

What is wrong with this definition?

The metre claims to be a 'non-imperial' basis of measurement.

But the basis of the metre is the imperial or ephemeral second, which is the ultimate imperial measurement. Seconds are an imperial unit. The measurement of time is fundamental to the ruler ... get it?

So the arbitrarily devised metre is founded upon the imperial second. Oops. Now why again did you say the metric system is 'superior' to the imperial system?

Metric supremacists are fascist rubes who don't realize they were pwnd by the empire before their rebellion even had a name or gang sign. They wanted to overthrow the king and based their coup on the king's fundamental unit of regal measurement: time. Oops. This is a case of killing the baby in the cradle.

Imperial units of measurement are based upon things found in nature. The second is a division of the solar and astronomical day. A second is 1/86400th of a day, and is based again on sexigesimal math, which is found EVERYWHERE in nature.

Every good programmer should already know where this is going.

Day: 86400 seconds.
Day: 24 hours.
Hour: 3600 seconds.
Hour: minute squared.
Minute: 60 seconds.
3600 seconds * 24 hours = 86400 seconds.
60 seconds * 60 minutes = 3600 seconds = 1 hour

There is nothing arbitrary about this. The imperial measurement is neatly aligned to solar and astronomical cycles and to the latitudes and longitudes of the earth. In short, the imperial system of measurement had already measured the equatorial and tropical circuits of the earth and the sun's path over 3000 years ago, and based measurements upon that.

Then along came the metric aristocrats, who pretended this had never been done before, speculated a false circumference of the earth, and came up with a flawed metre based on that false measurement, then changed it decades later to the distance traveled by light in an imperial second, unaware that no constant speed of light has yet been proved conclusively, but only assumed.

Whereas the imperial system is based upon measurements which have been observed unchanged, verifiable, and reproducible, FOR THOUSANDS OF YEARS.

Tell me again why the metric system is, 'superior'?

The metre is merely a speculation and the so-called speed of light has NOT been conclusively proven, considering special relativity and all that other aristocratic bollocks. Also complicating the matter is the specific definition of, "light traveling in a vacuum." OK, sparky, how are you going to locate a laboratory in a vacuum at least 1 light second in length to conduct this experimental measurement and prove it?

This fallacy is called an 'unfalsifiable' claim. Yup, The metric system is based upon a pseudo-scientific conjecture and fallacy. Whereas the imperial system is based upon thousands of years of repeatable observation. And yet 'scientists' somehow are confused about the reality of the situation.

As I've said elsewhere, worldwide science and academia have been growing progressively more delusional for the past couple of centuries.

In the end the aristocrats will bow to the king they hate. Thank God Americans have refused to bow to this dumb idol. Stay strong Murrikanz.

Here's a shout out to the limeys who still weigh in stones! Long live the king's foot!

academicchatter@a.gup.pe

ursakhiin,

This is such a weird take to me. We don’t even colloquially discuss computer storage in terms of 1000.

The Greek terms were used from the beginning of computing and the new terms of kibi and mebi (etc.) were only added in 1998 when Members it the IEC got upset. But despite that, most personal computers still report in the binary way. The decimal is only used on boxes for marketing terms.

LodeMike,

most personal computers still report in the binary way.

Which ones?

ursakhiin,

Windows reports using binary and continues to use the Greek terms. Windows is still the holder of largest market share for PC operating systems.

LodeMike,

Yeah well windows is a POS so

Frederic,

Absolutely, I started computers in 1981, for me 1K is 1024 bytes and will always be. 1000 bytes is a scam

kbal,
@kbal@fedia.io avatar

Calling 1048576 bytes an "American megabyte" might be technically wrong, but it's still slightly less goofy-looking than the more conventional "MiB" notation. I wish you good luck in making it the new standard.

Ookami38,

Mp3s, standard def movies, HD movies, and 4k movies.

mindbleach,

I just made a joke about 1CD / 2CD rips, but god dangit, this is the right answer right here.

joelfromaus,
@joelfromaus@aussie.zone avatar

I’ve seen so many products advertised by how many “songs” or “movies” it can hold. Never mind you can encode the same movie to be massive or small. So I think we’ve found the right answer!

waz,

I know you asked about memory, but the computer I just assembled had a 750watt power supply. As an American I think we should refer to it as a “one horsepower power supply” instead.

uis,
BmeBenji,

That’s not bad, but is there a digital equivalent of a horse we could use?

mindbleach,
TomAwsm, (edited )

Nyan cats

benderbeerman,

Imperial, obviously: F(reedom)T(ons) and fractions thereof. 1FT is the amount of data that it takes to store the entire King James edition of the New Testament and the Bill of Rights as a PDF.

TheOakTree,

We should measure size of files/storage as a function of how many standardized png’s of an american flag would fit in the same amount of space.

mojo_raisin,

digital freedom units

Buttons,
@Buttons@programming.dev avatar

We should measure size of files/storage as a function of how many standardized png’s of an american flag would fit in the same amount of space.

Fixed it, I will not be oppressed by your standards

TheOakTree,

Surely it would be a standardized png determined by each state legislation so… of varying sizes.

Adalast,

It would be of the state flags, with resolution and compression determined by the state supreme courts obviously.

Tracyorama,
Tracyorama avatar

Bytes are not part of the metric system because computers use base 2 instead of base 10. However, the metric system does borrow prefixes to express data sizes, such as kilo-, mega-, giga-, tera-, and peta-, so we could just use english for the prefixes

andrewth09, (edited )

My CPU is running at 2.6 Triple thou cycles per imperial second (TTiS)

ikidd,
@ikidd@lemmy.world avatar

Triple Imperial Thousand Seconds?

litchralee,

I’m surprised there aren’t more suggestions which use intentionally-similar abbreviations. The American customary system is rich with abbreviations which are deceptively similar, and I think the American computer memory units should match; confusion is the name of the game. Some examples from existing units:

  • millimeter (mm) vs thou (mil)
  • meter (m) vs mile (mi)
  • kilo (k) vs grand (G)
  • kilonewtons (kN) vs knots (kn)
  • statute mile (m/sm) vs survey mile (mi) vs nautical mile (NM/nmi) vs nanometer (nm)
  • foot (ft) vs fathom (ftm)
  • chain (ch) vs Switzerland (ch)
  • teaspoon (tsp) vs tablespoon (tbsp)
  • ounce (oz) vs fluid ounce (fl oz) vs troy ounce (ozt) vs Australia (Ozzie)
  • pint (pt) vs point (pt)
  • grain (gr) vs gram (g)
  • Kelvin (K) vs Rankine (R; aka “Kelvin for Americans”)
  • short ton (t) vs long ton (???) vs metric tonne (t) vs refrigeration ton (TR)
melmi,
@melmi@lemmy.blahaj.zone avatar

We already have a confusing abbreviation: B vs b. One is bits, one is bytes.

It’s a pretty drastic difference. One Gb per second is only 125 MB per second. Don’t mess up your capitalization!

litchralee,

It’s for this reason I sometimes spell out the Bytes or bits. Eg: 88 Gbits/s or 1.44 MBytes

It’s also especially useful for endianness and bit ordering: MSByte vs MSbit

barsoap, (edited )

The knot is non-SI but perfectly metric and actually makes sense as a nautical mile is exactly one degree meridian. kn also doesn’t clash with kN, Newtons are always written with capital N. Capitalisation generally matters. No standard abbreviation exists for nautical miles but definitely don’t use nm because newtonnano metres.

That is, if you take all those colonial units out of there suddenly you’re left with SI units and things that work well with SI units.

Oh and a pint is 500ml, a pound is 500g, a hundredweight is 50kg (because 100 pound), and a teaspoon is rather approximate because everyone outside of North America will use an actual spoon you stir tea with. The important part is not the precise amount but distinguishing it from “a pinch” etc. I guess by extension ounces should be 25ml and 25g. While we’re at it: An inch is 25mm, and a foot an even 1/3rd of a metre while a yard is exactly one metre.

Did you know that a Newton metre is about exactly one chocolate bar metre? The work it takes to lift it in about standard gravity, that is. Very intuitive.

t for ton is a quirk in SI, you can use Mg if you want. There’s also other SI-adjacent strangeness such as the hectare, which is one hecto-are: While SI has meters for length and litres for volume somehow the are isn’t official for area.

litchralee,

The knot is non-SI but perfectly metric and actually makes sense as a nautical mile is exactly one degree meridian

I do admire the nautical mile for being based on something which has proven to be continually relevant (maritime navigation) as well as being brought forward to new, related fields (aeronautical navigation). And I am aware that it was redefined in SI units, so there’s no incompatibility. I’m mostly poking fun at the kN abbreviation; I agree that no one is confusing kilonewtons with knots, not unless there’s a hurricane putting a torque on a broadcasting tower…

No standard abbreviation exists for nautical miles

We can invent one: kn-h. It’s knot-hours, which is technically correct but horrific to look at. It’s like the time I came across hp-h (horsepower-hour) to measure gasoline energy. :(

if you take all those colonial unit

In defense of the American national pride, I have to point out that many of these came from the Brits. Though we’re guilty of perpetuating them, even after the British have given up on them haha

An inch is 25mm, and a foot an even 1/3rd of a metre while a yard is exactly one metre.

I’m a dual-capable American that can use either SI or US Customary – it’s the occupational hazard of being an engineer lol – but I went into a cold sweat thinking about all the awful things that would happen with a 25 mm inch, and even worse things with 3 ft to the meter. Like, that’s not even a multiple of 2, 5, or 10! At least let it be 40 inches to the meter. /s

There’s also other SI-adjacent strangeness such as the hectare

I like to explain to other Americans that metric is easy, using the hectare as an example. What’s a hectare? It’s about 2.47 acre. Or more relatable, it’s the average size of a Walmart supercenter, at about 107,000 sq ft.

1 hectare == 1 Walmart

barsoap,

We can invent one: kn-h. It’s knot-hours, which is technically correct but horrific to look at. It’s like the time I came across hp-h (horsepower-hour) to measure gasoline energy.

Quite standard, actually. If you buy a fridge over here it’d say something like “150 kWh/a”, which is 17.12 Watts, which is how much the fridge uses on average. People don’t pay for Watts, though, but for kWh, that’s what’s on the bill so kWh/a is way more practical if you want to convert to €/a. Also if you put more than one number in Watts in the docs civilians might get confused, ideally the only one you put there is connection power.

What’s a hectare?

I actually have no idea. I know that it’s what farmers pick up women with but I have no real mental image of how much it is. 100m, sure, make that a square but it’s still somehow without meaning.

but I went into a cold sweat thinking about all the awful things that would happen with a 25 mm inch,

Blame the Swedes, or more precisely Carl Edvard Johansson, inventor and manufacturer of gauge blocks. Before that the US and Brits had slightly incompatible definitions of inches and he split the difference pretty much in the middle and rounded a bit and ended up producing 25.4mm gauge blocks, and only after that industry even started to be precise and actually adhere to proper measures – without wide availability of reference gauge blocks that was impossible. He should’ve rounded just a bit further.

Perhyte,

No standard abbreviation exists for nautical miles but definitely don’t use nm because newton metres

Since as you mentioned Newtons are N not n, Newton meters are Nm. nm means nanometer.

barsoap,

yep brainfart too many newtons in the sentence before that

Andrew15_5,
@Andrew15_5@mander.xyz avatar

IEC

uis,

C13

Andrew15_5,
@Andrew15_5@mander.xyz avatar

https://en.m.wikipedia.org/wiki/File:IEC_60320_plugs.jpg?

mindbleach,

Increments of 700 MB. As laid down by the wizards of usenet: 1CD, 2CD, 3CD, etc.

And then extending that idea, 1.44 MB, 4.7 GB, and 50 GB units.

A disk is 1,510,294 bytes - because it’s 1.44 American megabytes, and a kilobyte is 1024 bytes, god dammit. They’re binary. A CD (or “disc”) is 486 disks. A DVD5 is 6 CDs, because a DVD9 only holds 12. A BDRXL is 24 DVD5s.

From there we have to defer to the other kind of “elders of the internet” and say a “terabit” is exactly 10 BDRXLs, because my dad absolutely refuses to use the word “terabyte.” It’s decimalized from there on out. Which sounds great until you realize an American terabit is 5.7% more than asinine SI “hard drive manufacturer” terabytes, but only 98% of a proper binary figure given the even dumber name “tebibyte.”

Adalast,

We can use bits instead of bytes. That way it can look 8x bigger than it really is and have no real bearing to modern computing.

John_McMurray,

No, those are not metric, they just borrowed some prefixes, although it’s not like metric designers invented those anyways.

jimbolauski,

Power of Two

1GB is 29.8975 pots

1MB is 19.9315 pots

csm10495,
@csm10495@sh.itjust.works avatar

I use jiffies to refer to clock speed.

uis,

BogoMIPS

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmerhumor@lemmy.ml
  • kavyap
  • osvaldo12
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • tacticalgear
  • slotface
  • khanakhh
  • everett
  • rosin
  • Durango
  • megavids
  • GTA5RPClips
  • cisconetworking
  • vwfavf
  • InstantRegret
  • normalnudes
  • modclub
  • ngwrru68w68
  • cubers
  • Leos
  • provamag3
  • tester
  • anitta
  • JUstTest
  • All magazines