node.js - Trying to create negative nodejs (npm) long values -
below, long.neg_one produces desired results. alternative way construct long object using negative value?
https://www.npmjs.com/package/long coffee> l=new long "20000" { low: 20000, high: 0, unsigned: false } coffee> (l.multiply long.neg_one).tostring() '-20000' coffee> long.neg_one { low: -1, high: -1, unsigned: false }
what wrong (below)? why didn't long not set high value -1 above?
coffee> new long "-1" { low: -1, high: 0, unsigned: false } coffee> (new long "-1").tostring() '4294967295' coffee> long.neg_one.tostring() '-1'
new long "2000" wrong. instead, use long.fromstring "2000"
Comments
Post a Comment