codethesaur.us icon indicating copy to clipboard operation
codethesaur.us copied to clipboard

Number types are not useful for all languages

Open salmonmoose opened this issue 4 years ago • 3 comments

Expected Behavior

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

Actual Behavior

No relevant category to match against.

Specifications

salmonmoose avatar Nov 09 '20 06:11 salmonmoose

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!

geekygirlsarah avatar Nov 10 '20 14:11 geekygirlsarah

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.

cafce25 avatar Feb 21 '22 22:02 cafce25

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

geekygirlsarah avatar Feb 22 '22 14:02 geekygirlsarah