codethesaurus / codethesaur.us

A polyglot developer reference tool to compare programming language concepts side-by-side! Great for learning new languages or using for reference.
https://codethesaur.us
GNU Affero General Public License v3.0
283 stars 162 forks source link

Number types are not useful for all languages #85

Open salmonmoose opened 3 years ago

salmonmoose commented 3 years ago

Expected Behavior

Add data types for Javascript (and derivatives) with 56 bit floats

Actual Behavior

No relevant category to match against.

Specifications

geekygirlsarah commented 3 years ago

We chatted about this on my Twitch stream, but I'll write out a little bit, and it's described a bit in https://docs.codethesaur.us/thesaurus/ .

To add new types to the thesaurus, you'll need to go into _meta/data_types.json and add the new types within the right categories section, then implement the section in the spot below it. Try to maintain similar formatting to what's already there, and keep them in some sort of logical order. PR those changes on their own. I'll get an email with the PR to review.

After that, you can then implement the same part in the language itself (in your case, JavaScript). Since you'd add in JS, just make one PR for the whole thing.

And thanks for taking this on! I'd love it if you added a comment onto issue #87 as it sounds like what you're trying to do anyway and I can let you claim it as yours!

cafce25 commented 2 years ago

As far as I can tell all standardized versions of Javascript use 64bit IEEE 754 double precision floating points for Numbers so I don't think we need this specific variant.

geekygirlsarah commented 2 years ago

I wonder if @salmonmoose's original thought was that 64-bit floats have 56 bits of coefficient and 8 bits of exponent?