[OPEN] Little Bug with Big Numbers (Increment Button)

That is a lot if typing

2 Likes

Try to tag @. omtl next time

1 Like

henry I saw you edit the title.

1 Like

Is NaN 0? Idk

2 Likes

no, NaN means “Not a Number”, it the way in FP to say: this result isn’t a number on the real number line. Like from 0 divided by 0. But FP can represent both positive and negative infinity (not sure how HS handles that though)

1 Like

wait if this "It’s not a big deal " is an [OPEN] bug, can we make the broken undo button:

be open too?

1 Like

having a headache with 9999999999999999999999999

1 Like

Yes it is considered 0, since NaN is not convertable to an integer, so it’s 0 by default.

1 Like

@Cutelittlekittycat sorry for my confusing answer- that HS shows NaN as 0 is what I should have figured out and answered with.

@JonnyGamer do you really want HS to have different numeric types? It doesn’t have any types now, including string vs number, which causes some surprises but basically woks. Types can add extra confusion for new learners, and adding types will entail changes in the UI that have no precedent, as far as I can tell.

2 Likes

I think data types are in the roadmap.

That’s a good point that it may not be the friendliest for new learners.

3 Likes

It will be interesting to see how THT creates a GUI for a typed HS.

But srsly is fixing the undo button not on the roadmap?

2 Likes

NaN (Not a Number) can also be known as Infinity or Undefined.

1 Like

Actually in JavaScript it’s a completely different value from undefined

It’s what you get when you perform arithmetic operations to values that aren’t numbers

It’s has a type of number because even if you are trying to divide 39 by “we’re no strangers to love” it still has to return a number, so it returns NaN


I think this bug might be because JavaScript has 2 different types of numbers, normal ones and big bois
Big numbers are represented in JavaScript like 99999999999n or 3939n
This method was yoinked from lower level languages.
I’m not sure whether hs doesn’t use big numbers but it could be because of that

console.log(typeof 1n)//supposed to log "bigint" but for some reason gives me an error
console.log(typeof BigInt("1"))//works
1 Like

Oh wait this isn’t a bug with the player

I think the editor was written in objective C

:man_shrugging: computers are bad at big/precise numbers idk

1 Like

Nice use of Rick Roll, lol.

2 Likes

Even though HS is based on JavaScript they have different numeric behaviors. HS doesn’t support bigints, and even though IEEE 754 and it’s various implementations (including in Javascript) distinguish between NaN and other numbers, when you evaluate in HS an expression — that in JavaScript would generate a NaN — in HS you just get zero.

I don’t think you can get HS to store an Infinity either, another special floating point value.

2 Likes

Actually I remember from really long ago that I kept pressing 9 on a keypad I made and at one point the display suddenly showed “infinity”

1 Like