Patashu / break_infinity.js

A replacement for decimal.js for incremental games who want to deal with very large numbers (bigger in magnitude than 1e308, up to as much as 1e(9e15) ) and want to prioritize speed over accuracy.
MIT License
201 stars 35 forks source link

I need help #122

Closed DatDerpyLuke closed 3 years ago

DatDerpyLuke commented 3 years ago

Hi... How do I import the decimal class into the main javascript file? I thought it was easier, I tried this: image Either import doesn't work or I messed up the variables (most likely) image image Or I messed up the .add/.div/.etc image image Can you help me, please?

Patashu commented 3 years ago

so ironically I'm not actually a javascript expert so I don't know the correct way to do this lol

but both Synergism and Antimatter Dimensions just shove break_infinity.js into a script tag before anything that uses Decimal so they're both in the same scope, so maybe just do that?

https://github.com/Pseudonian/SynergismOfficial/blob/master/index.html

for a game that has working imports of the type you're trying to do, you can check out https://github.com/eevee/lexys-labyrinth/blob/master/js/game.js and try to figure out what it's doing differently from you. honestly, the syntax you're using looks the same so I have no immediate ideas.

sorry I'm not more help lol

Razenpok commented 3 years ago

You should use

import Decimal from "break_infinity.js";

instead of

import { Decimal } from "break_infinity.js";
DatDerpyLuke commented 3 years ago

You should use

import Decimal from "break_infinity.js";

instead of

import { Decimal } from "break_infinity.js";

Hmm... I'll try it, if it works, I'll close the thread. Anyways, ty!

DatDerpyLuke commented 3 years ago

I changed the code, Githubissues.

  • Githubissues is a development platform for aggregating issues.