mentat-collective / emmy

The Emmy Computer Algebra System.
https://emmy.mentat.org
GNU General Public License v3.0
406 stars 24 forks source link

state-advancer throws "Cannot mix BigInt and other types" #133

Closed kloimhardt closed 1 year ago

kloimhardt commented 1 year ago

The following example (taken from the SICM book) throws the error "TypeError: Cannot mix BigInt and other types, use explicit conversions"

(defn harmonic-state-derivative [m k]
   (Lagrangian->state-derivative (L-harmonic m k)))

(def up01 (up 1.0 (up 1.0 2.0) (up 3.0 4.0)))

(def harmonic-state-advancer
  (state-advancer harmonic-state-derivative 2.0 1.0))

(harmonic-state-advancer up01, 10.0, 1.0e-12)

To reproduce, clone the Emmy as ES6 Module repository, run shadow-cljs watch emmy-esm and open http://localhost:9000/barebones.html

sritchie commented 1 year ago

Thank you! Would you mind pasting the error too?

kloimhardt commented 1 year ago

When I open barebones.html in the browser, the error

TypeError: Cannot mix BigInt and other types, use explicit conversions

is shown on the screen.

sritchie commented 1 year ago

Ah, that pesky one... okay thank you, I will track it down!!

sritchie commented 1 year ago

Fixed by #134 and patched over at that repo by https://github.com/kloimhardt/emmy-module/pull/1.