Better HN
topnewbestaskshowjobs
Log inSign up

bazoom42

1,907 karma · joined Feb 5, 2022 (4y ago) · 1,028 submissions

Submissions

comment 4d ago · link · parent

No, because 0.9999… is 1, as shown in the article.

comment 1w ago · link · parent

Btw, processors tend to use the same precision for all floating point operations. So there is really no reason to use float in the common case, since it is not faster or cheaper than double.

Float may be appropriate in some specific cases (interoperability, huge arrays) but should not be the default.

comment 1w ago · link · parent

The suffix for double is “d”. It is just a syntax-level shortcut to leave it out. From the compilers perspective “1.0d” and “1.0” are exactly equivalent.

It is just like `int` being a syntactic shortcut for System.Int32. It doesnt mean the size is unspecified, it just means it is specified using a shorter syntax.

comment 1w ago · link · parent

You suggestions seem like complex solutions to a non-existing problem. If you need a decimal literal, just use the “m”-suffix! Why introduce weird ambiguities? E.g what would be the type of the expression `1.0 / 3.0` in your system? It might not be assigned directly to a variable but could be an argument to an overloaded method.

The bottom line is you need to know if you are using a decimal or a double. If you think suffix-less literals are confusing, just make it a rule to always use a suffix.

Why is double the default for suffix-less numbers? Probably because it is a standard floating point type supported by all processors and languages. Seems like a reasonable default.

comment 1w ago · link · parent

Why? What do you mean?

comment 1w ago · link · parent

A cast is an explicit syntax which let the programmer say “I know more than the compiler”. If you don’t, don’t use cast.

If the conversion is safe (eg converting from an integer to decimal) then the cast syntax is unnecessary.

comment 1w ago · link · parent

The literal 0.1 is a double. If you want a decimal literal use the “m” postfix like 0.1m.

Then you dont need the cast and there is no problem with hidden roundings.

comment 1w ago · link · parent

There will always be a billion way to write the same algorithm in a Turing-complete language. That is not the point.

comment 1w ago · link · parent

In cases where you have to convert from float/double to decimal you should use an explicit rounding method, not just a raw cast.

comment 2w ago · link · parent

You shouldn’t cast from double to decimal anyway. Just use decimal throughout.

comment 2w ago · link · parent

> didn't make for good career advancement for anyone to look into it let alone say it.

Say what? You comment is rather vague but seem to suggest you have some knowledge which have been suppressed by academia.

comment 2w ago · link · parent

> it's generally not okay for creators and commentators to go, "Come to your own conclusions, wink wink."

This viewpoint seem completely crazy to me. If audiences cannot be trusted to think for themselves, why should artists be trusted with telling them how to think?

comment 2w ago · link · parent

But is it the people who misunderstand the movie, or is it the movie which fails to make the point you think it should make?

It is a classical hollywood trope to preset a “bad guy” protagonist as cool, charming, and resourceful and with a glamorous life.

Hollywood know how to make you like a character and how to make you dislike one.

comment 2w ago · link · parent

In this context it means they invaded the Roman empire.

comment 2w ago · link · parent

If I understand the article correctly, there is DNA evidence of mass migration from Scandinavia to Northern Poland, but going further south, the evidence points to migration of a smaller elite rather than mass migration.

> In the beginning, there was a big migration, but later they started mingling, and the transmission of Gothic was more of a cultural nature.

In this comment section it seems people really want it to be one or the other, evidence be damned.

comment 2w ago · link · parent

Science is not just believing what sounds plausible. It is about gathering evidence. Having historical, archeological and DNA evidence is a lot stronger that just historical evidence alone.

comment 2w ago · link · parent

But why not just enable noUncheckedIndexedAccess?

comment 2w ago · link · parent

Can’t the type system reject code which undermines the soundness of the type system?

comment 3w ago · link · parent

How is what is common in the US relevant when we are talking about the church in Armenia? Christianity is a worldwide phenomenon and much older than the US. Defining Christianity relative to what is the most common denominations in the US is beyound stupid.

comment 3w ago · link · parent

> calling them "Christian" is a bit of a stretch

Isn’t the Armenian church like the oldest Christian church? Why wouldn’t they be called Christian?

comment 3w ago · link · parent

HN uses JavaScript though, not just plain HTML.

comment 4w ago · link · parent

Actors routinely memorize whole plays, so it is not implausible for someone to have memorized 15 min of A Tale of Two Cities.

The claim in the article is he remembered everything he read perfectly, which is wild. But another source claim he specifically memorized the Dickens book to train his English, which sounds more likely.

comment 1mo ago · link · parent

Is many worlds falsifiable?

comment 1mo ago · link · parent

Why didnt you vibecode the The nonfunctional requirements?

comment 1mo ago · link · parent

CSS is for styling and layout, but there is no conceptual reason this couldn’t be defined through functions.

“Code” is not a concern like semantic vs style.

comment 1mo ago · link · parent

Most regex dialects allow whitespace and comments, so that already gets you halfway there.

comment 1mo ago · link · parent

Who would want to use a browser which couldn’t render html? Even if a better format arrived, there are millions of already existing html pages which people would want to be able to read.

comment 1mo ago · link · parent

The cool thing with a wasm-based xslt implementation is there is no need for the browser vendors to gate-keep it. Just use the implementation you prefer.
12345
35